diff options
author | George Hazan <ghazan@miranda.im> | 2021-03-18 23:02:05 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2021-03-18 23:02:05 +0300 |
commit | 14cc5fc5d8442e99663707501924e589f7a55204 (patch) | |
tree | 48db9ff6c5956baff6aab2bc4eebb8e92253671b | |
parent | 6e04912b716a5fd8d17575cd098a4f1117442ca0 (diff) |
fixes #2782 (dynamic plugin loading problems)
-rw-r--r-- | src/mir_app/src/pluginopts.cpp | 10 |
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;
|