Fixed memory leak caused by HtmlCanvasElement not being released. (#1786)

* Fixed memory leak caused by HtmlCanvasElement not being released.

* modify unroot

* add comment
This commit is contained in:
cary
2019-08-02 10:21:48 +08:00
committed by minggo
parent ca5c7fd25b
commit 7576a53822
@@ -444,6 +444,12 @@ static bool js_CanvasRenderingContext2D_setCanvasBufferUpdatedCallback(se::State
se::ScriptEngine::getInstance()->clearException();
}
};
// Add an unroot to avoid the root of the copy constructor caused by the internal reference of Lambda.
if (jsThis.isObject())
{
jsThis.toObject()->unroot();
}
jsFunc.toObject()->unroot();
arg0 = lambda;
}
else