V3.6.0 bug (#11966)

* Fix access to application class on exit
This commit is contained in:
qiuguohua
2022-07-14 09:49:53 +08:00
committed by GitHub
parent b395f4d5dc
commit cd032aebd4
+9 -2
View File
@@ -577,8 +577,15 @@ bool jsb_global_load_image(const ccstd::string &path, const se::Value &callbackV
if (loadSucceed) {
imgInfo = createImageInfo(img);
}
CC_CURRENT_ENGINE()->getScheduler()->performFunctionInCocosThread([=]() {
auto app = CC_CURRENT_APPLICATION();
if (!app) {
delete imgInfo;
delete img;
return;
}
auto engine = app->getEngine();
CC_ASSERT(engine != nullptr);
engine->getScheduler()->performFunctionInCocosThread([=]() {
se::AutoHandleScope hs;
se::ValueArray seArgs;