mirror of
https://gitee.com/openharmony/arkui_ace_engine
synced 2024-11-27 09:12:41 +00:00
Add workload when oom
Issue: https://e.gitee.com/openharmony/issues/table?issue=IAU2J2 Signed-off-by: quiet-thought <chenjingxiang1@huawei.com> Change-Id: I9fb50d508766a16f4239dc7535940eff8974c2e3
This commit is contained in:
parent
e4e8fa2cb6
commit
ad510b912e
@ -355,8 +355,16 @@ void ArkJSRuntime::ThrowError(const std::string& msg, int32_t code)
|
||||
void ArkJSRuntime::RegisterUncaughtExceptionHandler(UncaughtExceptionCallback callback)
|
||||
{
|
||||
JSNApi::EnableUserUncaughtErrorHandler(vm_);
|
||||
std::weak_ptr<ArkJSRuntime> weakThis = shared_from_this();
|
||||
JSNApi::RegisterUncatchableErrorHandler(vm_,
|
||||
std::bind(&ArkJSRuntime::HandleUncaughtExceptionWithoutNativeEngine, this, std::placeholders::_1, nullptr));
|
||||
[weakThis](auto& tryCatch) {
|
||||
auto sharedThis = weakThis.lock();
|
||||
if (sharedThis) {
|
||||
sharedThis->HandleUncaughtExceptionWithoutNativeEngine(tryCatch, nullptr);
|
||||
} else {
|
||||
LOGE("ArkJSRuntime has been destructed.");
|
||||
}
|
||||
});
|
||||
uncaughtErrorHandler_ = callback;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user