Adding a forward that lets you know when another plugin is unloaded#948
Adding a forward that lets you know when another plugin is unloaded#948OkyHp wants to merge 3 commits intoalliedmodders:masterfrom
Conversation
|
Your title, description, and code all say different things - I'm not sure what this is doing. Please take a look at the Pull Requests section of the contribution guide: https://github.com/alliedmodders/sourcemod/blob/master/.github/CONTRIBUTING.md#pull-requests |
Sorry, poor English. Fixed the title. |
asherkin
left a comment
There was a problem hiding this comment.
I don't think we want to take functionality like this at this time - it was raised as a feature request in #890 and discussed out-of-band then, and adding something like this just punches a lot of holes into the plugin dependency system. I'd feel more comfortable with something that acted on more well-defined relationships like the existing library system. I suggest continuing the discussion in #890 and the linked forum thread.
core/logic/PluginSys.cpp
Outdated
| pFunction = plugin->GetBaseContext()->GetFunctionByName("OnPluginEndEx"); | ||
| if (pFunction) | ||
| { | ||
| pFunction->PushCell(plugin->GetMyHandle()); |
There was a problem hiding this comment.
You're pushing the handle of the plugin you're calling the function on here, not the handle of the unloading plugin.
This may allow the kernel plugin to delete the data of the module that is being unloaded to avoid problems the next time the module is loaded.