Skip to content

Commit

Permalink
Unload plugin automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
alabuzhev committed Feb 3, 2023
1 parent 4423c63 commit 659bafe
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions unicon/plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,7 @@ extern "C" void WINAPI SetStartupInfoW(const struct PluginStartupInfo* PSInfo)

PSInfo->Message(&MainUUID, &MainUUID, FMSG_WARNING | FMSG_MB_OK, {}, Items, std::size(Items), 0);
}

if (const auto Handle = reinterpret_cast<HANDLE>(PSInfo->PluginsControl(INVALID_HANDLE_VALUE, PCTL_FINDPLUGIN, PFM_GUID, const_cast<GUID*>(&MainUUID))))
PSInfo->PluginsControl(Handle, PCTL_UNLOADPLUGIN, 0, {});
}

0 comments on commit 659bafe

Please sign in to comment.