Use correct way to free resource

This commit is contained in:
jun7 2018-05-25 13:39:58 +09:00
parent 8e55f34fe9
commit 8a0d483d1a

8
ab.c
View File

@ -80,12 +80,8 @@ static void pageinit(WebKitWebExtension *ex, WebKitWebPage *kp)
g_object_set_data(G_OBJECT(kp), "wyebcheck", check); g_object_set_data(G_OBJECT(kp), "wyebcheck", check);
untilcb(kp); untilcb(kp);
g_object_weak_ref(G_OBJECT(kp), (GWeakNotify)g_source_remove,
//to catch destroy event in shared proc, set loop srcs to the pages GUINT_TO_POINTER(g_timeout_add(11 * 1000, (GSourceFunc)untilcb, kp)));
//make sure shared proc is not only the multi web proc but target=_blank or js
g_object_set_data_full(G_OBJECT(kp), "wyebloop",
GUINT_TO_POINTER(g_timeout_add(11 * 1000, (GSourceFunc)untilcb, kp)),
(GDestroyNotify)g_source_remove);
} }
G_MODULE_EXPORT void webkit_web_extension_initialize_with_user_data( G_MODULE_EXPORT void webkit_web_extension_initialize_with_user_data(