mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 08:17:34 +00:00
PluginManager: fixed mishandling of self-disabling plugins in enablePlugins()
this caused a leak of the plugin context, PluginEnableEvent to be called with a disabled plugin, and the plugin's scheduler to get ticked.
This commit is contained in:
parent
3e90c3072a
commit
c9c50e16ec
@ -435,10 +435,11 @@ class PluginManager{
|
||||
|
||||
$plugin->getScheduler()->setEnabled(true);
|
||||
$plugin->onEnableStateChange(true);
|
||||
if($plugin->isEnabled()){ //the plugin may have disabled itself during onEnable()
|
||||
$this->enabledPlugins[$plugin->getDescription()->getName()] = $plugin;
|
||||
|
||||
$this->enabledPlugins[$plugin->getDescription()->getName()] = $plugin;
|
||||
|
||||
(new PluginEnableEvent($plugin))->call();
|
||||
(new PluginEnableEvent($plugin))->call();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user