From 9ff874edf1c5c64780cf03bce49d7f10ba03c5c4 Mon Sep 17 00:00:00 2001 From: Pong Date: Mon, 22 Feb 2021 20:50:03 +0800 Subject: [PATCH] fix(spine-plugin): errors throw while game destroy --- plugins/spine/src/SpinePlugin.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/plugins/spine/src/SpinePlugin.js b/plugins/spine/src/SpinePlugin.js index 7a1e01918..e34b462c4 100644 --- a/plugins/spine/src/SpinePlugin.js +++ b/plugins/spine/src/SpinePlugin.js @@ -1128,18 +1128,16 @@ var SpinePlugin = new Class({ */ gameDestroy: function () { - this.destroy(); + this.pluginManager.removeGameObject('spine', true, true); + this.pluginManager.removeGameObject('spineContainer', true, true); + this.pluginManager = null; if (sceneRenderer) { sceneRenderer.dispose(); + sceneRenderer = null; } - this.sceneRenderer = null; - this.pluginManager = null; - - this.pluginManager.removeGameObject('spine', true, true); - this.pluginManager.removeGameObject('spineContainer', true, true); } });