[Service] Unset post callbacks 96/272696/3
authorDongHyun Song <dh81.song@samsung.com>
Wed, 23 Mar 2022 00:46:07 +0000 (09:46 +0900)
committerDongHyun Song <dh81.song@samsung.com>
Thu, 31 Mar 2022 01:38:35 +0000 (01:38 +0000)
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 <dh81.song@samsung.com>
wrt_app/common/wrt_xwalk_extension.ts

index 4e32394..c0c9971 100644 (file)
@@ -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;
 }