mirror of https://github.com/axmolengine/axmol.git
fix memory leak
This commit is contained in:
parent
5883c7c388
commit
fba4bead70
|
@ -107,9 +107,7 @@ bool ClippingNode::init()
|
||||||
|
|
||||||
bool ClippingNode::init(Node *stencil)
|
bool ClippingNode::init(Node *stencil)
|
||||||
{
|
{
|
||||||
CC_SAFE_RELEASE(_stencil);
|
|
||||||
setStencil(stencil);
|
setStencil(stencil);
|
||||||
CC_SAFE_RETAIN(_stencil);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -292,6 +290,9 @@ Node* ClippingNode::getStencil() const
|
||||||
|
|
||||||
void ClippingNode::setStencil(Node *stencil)
|
void ClippingNode::setStencil(Node *stencil)
|
||||||
{
|
{
|
||||||
|
if (_stencil == stencil)
|
||||||
|
return;
|
||||||
|
|
||||||
#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS
|
#if CC_ENABLE_GC_FOR_NATIVE_OBJECTS
|
||||||
auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine();
|
auto sEngine = ScriptEngineManager::getInstance()->getScriptEngine();
|
||||||
if (sEngine)
|
if (sEngine)
|
||||||
|
|
Loading…
Reference in New Issue