From: DongHyun Song Date: Wed, 23 Mar 2022 00:46:07 +0000 (+0900) Subject: [Service] Unset post callbacks X-Git-Tag: submit/tizen/20220331.160022^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=124042b9cc4c28c514d218a1b92e5feb239baf1d;p=platform%2Fframework%2Fweb%2Fwrtjs.git [Service] Unset post callbacks Unexpectedly, post callbacks can be fired from webapi worker thread after its wrt::api::XwalkExtension instance was destroyed. Thus, this will unset the post callbacks on unloadInstance API. Related chromium-efl patch: https://review.tizen.org/gerrit/272695/ Change-Id: I82e5bdfc48bed4b4d208ca6dd485bdffd1c31a0d Signed-off-by: DongHyun Song --- diff --git a/wrt_app/common/wrt_xwalk_extension.ts b/wrt_app/common/wrt_xwalk_extension.ts index 4e32394f..c0c99718 100644 --- a/wrt_app/common/wrt_xwalk_extension.ts +++ b/wrt_app/common/wrt_xwalk_extension.ts @@ -230,6 +230,9 @@ export const setRuntimeMessageHandler = (handler: (type: string, data?: string, } export let cleanup = () => { + for (const name in extensions_) { + extensions_[name].unloadInstance(); + } delete global.tizen; instance = undefined; }