Skip to content

Commit

Permalink
fix crash when unloading plugin a second time
Browse files Browse the repository at this point in the history
  • Loading branch information
DubbleClick committed May 1, 2024
1 parent 55ca391 commit 64e30ac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Dependencies/GWCA
Submodule GWCA updated from c3367f to 7de1ce
3 changes: 3 additions & 0 deletions GWToolboxdll/Modules/PluginModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ namespace {
plugin.initialized = false;
plugin.terminating = false;
plugin.instance = nullptr;
if (SUCCEEDED(FreeLibrary(plugin.dll))) {
plugin.dll = nullptr;
}
std::erase_if(plugins_loaded, [plugin_ptr](auto p) { return p == plugin_ptr; });
return true;
}
Expand Down

0 comments on commit 64e30ac

Please sign in to comment.