summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mir_app/src/pluginopts.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/mir_app/src/pluginopts.cpp b/src/mir_app/src/pluginopts.cpp
index 1236f28ed9..f0c805f1f4 100644
--- a/src/mir_app/src/pluginopts.cpp
+++ b/src/mir_app/src/pluginopts.cpp
@@ -237,6 +237,7 @@ static bool LoadPluginDynamically(PluginListItemData *dat)
}
}
+ dat->bWasLoaded = true;
dat->hInst = ppb->getInst();
NotifyFastHook(hevLoadModule, (WPARAM)&ppb->getInfo(), (LPARAM)ppb->getInst());
return true;
@@ -249,6 +250,7 @@ static bool UnloadPluginDynamically(PluginListItemData *dat)
if (!Plugin_UnloadDyn(p))
return false;
+ dat->bWasLoaded = false;
dat->hInst = nullptr;
}
return true;
@@ -374,10 +376,8 @@ public:
PluginListItemData *dat = (PluginListItemData*)lvi.lParam;
if (iState == 0x2000) { // enabling plugin
if (!dat->bWasLoaded) {
- if (!dat->bRequiresRestart) {
+ if (!dat->bRequiresRestart)
LoadPluginDynamically(dat);
- dat->bWasLoaded = true;
- }
else {
bufRestart.AppendFormat(L" - %s\n", buf);
needRestart = true;
@@ -386,10 +386,8 @@ public:
}
else { // disabling plugin
if (dat->bWasLoaded) {
- if (!dat->bRequiresRestart) {
+ if (!dat->bRequiresRestart)
UnloadPluginDynamically(dat);
- dat->bWasLoaded = false;
- }
else {
bufRestart.AppendFormat(L" - %s\n", buf);
needRestart = true;