diff --git a/cocos2d/core/CCNode.js b/cocos2d/core/CCNode.js index 386ef2bf6d..f345764f6a 100644 --- a/cocos2d/core/CCNode.js +++ b/cocos2d/core/CCNode.js @@ -1018,8 +1018,7 @@ var Node = cc.Class({ this._parent = null; } } - else if (CC_TEST ? (/* make CC_JSB mockable*/ Function('return CC_JSB'))() : CC_JSB) { - this._sgNode.release(); + else if (CC_JSB) { this._sgNode._entity = null; this._sgNode = null; } diff --git a/test/qunit/unit-es5/test-node.js b/test/qunit/unit-es5/test-node.js index 8f40d2512c..3b411c84d8 100644 --- a/test/qunit/unit-es5/test-node.js +++ b/test/qunit/unit-es5/test-node.js @@ -365,33 +365,6 @@ test('attach events', function () { cc.engine.off('node-detach-from-scene', onDetach); }); -test('release sg node', function () { - var isJSB = CC_JSB; - CC_JSB = true; - - var parent = new cc.Node(); - var child = new cc.Node(); - child.parent = parent; - - var childReleased = false; - var parentReleased = false; - - child._sgNode.release = function () { - childReleased = true; - }; - parent._sgNode.release = function () { - parentReleased = true; - }; - - parent.destroy(); - cc.Object._deferredDestroy(); - - strictEqual(parentReleased, true, 'should release parent sg node'); - strictEqual(childReleased, true, 'should release child sg node'); - - CC_JSB = isJSB; -}); - test('getBoundingBox', function () { var node = new cc.Node(); node.anchorX = 0.5;