mirror of
https://github.com/photonstorm/phaser
synced 2024-11-27 15:12:18 +00:00
Destroy will now clear out all custom plugins. Fix #3856
This commit is contained in:
parent
75db482ec6
commit
063a432ec9
1 changed files with 9 additions and 1 deletions
|
@ -804,7 +804,8 @@ var PluginManager = new Class({
|
|||
/**
|
||||
* Destroys this Plugin Manager and all associated plugins.
|
||||
* It will iterate all plugins found and call their `destroy` methods.
|
||||
* Note that the PluginCache is NOT cleared by this as it doesn't hold any plugin instances.
|
||||
*
|
||||
* The PluginCache will remove all custom plugins.
|
||||
*
|
||||
* @method Phaser.Plugins.PluginManager#destroy
|
||||
* @since 3.8.0
|
||||
|
@ -816,6 +817,13 @@ var PluginManager = new Class({
|
|||
this.plugins[i].plugin.destroy();
|
||||
}
|
||||
|
||||
PluginCache.destroyCustomPlugins();
|
||||
|
||||
if (this.game.noReturn)
|
||||
{
|
||||
PluginCache.destroyCorePlugins();
|
||||
}
|
||||
|
||||
this.game = null;
|
||||
this.plugins = [];
|
||||
this.scenePlugins = [];
|
||||
|
|
Loading…
Reference in a new issue