Skip to content

Adding a forward that lets you know when another plugin is unloaded#948

Closed
OkyHp wants to merge 3 commits intoalliedmodders:masterfrom
OkyHp:master
Closed

Adding a forward that lets you know when another plugin is unloaded#948
OkyHp wants to merge 3 commits intoalliedmodders:masterfrom
OkyHp:master

Conversation

@OkyHp
Copy link
Contributor

@OkyHp OkyHp commented Jan 12, 2019

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.

@asherkin
Copy link
Member

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

@OkyHp OkyHp changed the title Automatic unloading of dependent plugins Adding a forward that lets you know when another plugin is unloaded Jan 12, 2019
@OkyHp
Copy link
Contributor Author

OkyHp commented Jan 12, 2019

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.

Copy link
Member

@asherkin asherkin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

pFunction = plugin->GetBaseContext()->GetFunctionByName("OnPluginEndEx");
if (pFunction)
{
pFunction->PushCell(plugin->GetMyHandle());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're pushing the handle of the plugin you're calling the function on here, not the handle of the unloading plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants