fixed: in Functions::CheckSpecialFile() after parsing new mount points

the cur->mount pointer was pointing at the old mount object
(which may no longer exists)
This commit is contained in:
Tomasz Sowa 2021-02-16 17:23:36 +01:00
parent 4625451c85
commit a2b19547a3
2 changed files with 8 additions and 1 deletions

View File

@ -5,7 +5,7 @@
*/
/*
* Copyright (c) 2009-2018, Tomasz Sowa
* Copyright (c) 2009-2021, Tomasz Sowa
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -222,6 +222,11 @@ void Mounts::ReadMounts(const std::wstring & mounts)
mount_parser.Parse(mounts, mount_tab);
CalcCurMount();
// IMPROVE ME
// cur->mount is pointing to the empty mount (it is set in functions.cpp in CheckSpecialFile method)
// may would be better to call WINIX_FSTAB_CHANGED after the cur->mount is set?
// some plugins are using 'cur' object
plugin->Call((Session*)0, WINIX_FSTAB_CHANGED);
}

View File

@ -168,7 +168,9 @@ Error Functions::CheckSpecialFile(const Item & item)
{
log << log3 << "Functions: reloading mount points" << logend;
cur->mount = system->mounts.GetEmptyMount();
system->mounts.ReadMounts(item.content);
cur->mount = system->mounts.pmount;
templates->ReadNewIndexTemplates();
templates->ReadNewChangeTemplates();