Skip to content

Commit f7a08bb

Browse files
fixed removeChild bug
1 parent 7fa513c commit f7a08bb

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

cocos2d/base_nodes/CCNode.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,7 +1026,9 @@ cc.Node = cc.Class.extend(/** @lends cc.Node# */{
10261026
*/
10271027
removeFromParent:function (cleanup) {
10281028
if (this._parent) {
1029-
cleanup = cleanup || true;
1029+
if (cleanup == null){
1030+
cleanup = true;
1031+
}
10301032
this._parent.removeChild(this, cleanup);
10311033
}
10321034
},
@@ -1051,7 +1053,9 @@ cc.Node = cc.Class.extend(/** @lends cc.Node# */{
10511053
return;
10521054
}
10531055

1054-
cleanup = cleanup || true;
1056+
if (cleanup == null){
1057+
cleanup = true;
1058+
}
10551059
if (this._children.indexOf(child) > -1) {
10561060
this._detachChild(child, cleanup);
10571061
}

0 commit comments

Comments
 (0)