Merge pull request #1772 from zilongshanren/optimize-bmfont-load-speed

fix Editor sgLabel pool issue
This commit is contained in:
Wang Nan
2017-06-29 09:57:43 +08:00
committed by GitHub
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -598,6 +598,7 @@ var Label = cc.Class({
var sgNodeBeforeDestroy = this._sgNode;
this._super();
if (sgNodeBeforeDestroy) {
sgNodeBeforeDestroy.removeFromParent(true);
_ccsg.Label.pool.put(sgNodeBeforeDestroy);
}
}
+1 -1
View File
@@ -1247,7 +1247,7 @@ _ccsg.Label = _ccsg.Node.extend({
});
_ccsg.Label.pool = new JS.Pool(function (label) {
if (!(label instanceof _ccsg.Label)) {
if (CC_EDITOR || !(label instanceof _ccsg.Label)) {
return false;
}
label._string = "";