mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-01 15:52:40 +08:00
Merge pull request #1772 from zilongshanren/optimize-bmfont-load-speed
fix Editor sgLabel pool issue
This commit is contained in:
@@ -598,6 +598,7 @@ var Label = cc.Class({
|
||||
var sgNodeBeforeDestroy = this._sgNode;
|
||||
this._super();
|
||||
if (sgNodeBeforeDestroy) {
|
||||
sgNodeBeforeDestroy.removeFromParent(true);
|
||||
_ccsg.Label.pool.put(sgNodeBeforeDestroy);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 = "";
|
||||
|
||||
Reference in New Issue
Block a user