[epiphany/pgriffis/web-extension-storage: 2/3] WebExtensions: Destroy background page on disable




commit 36e45dbcc80726d0fa201db1f5640892719e4886
Author: Patrick Griffis <pgriffis igalia com>
Date:   Tue May 24 11:39:50 2022 -0500

    WebExtensions: Destroy background page on disable
    
    Part-of: <https://gitlab.gnome.org/GNOME/epiphany/-/merge_requests/1117>

 src/webextension/ephy-web-extension-manager.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/src/webextension/ephy-web-extension-manager.c b/src/webextension/ephy-web-extension-manager.c
index d48b5630c..71d6def44 100644
--- a/src/webextension/ephy-web-extension-manager.c
+++ b/src/webextension/ephy-web-extension-manager.c
@@ -201,7 +201,7 @@ ephy_web_extension_manager_constructed (GObject *object)
   EphyWebExtensionManager *self = EPHY_WEB_EXTENSION_MANAGER (object);
   g_autofree char *dir = g_build_filename (ephy_default_profile_dir (), "web_extensions", NULL);
 
-  self->background_web_views = g_hash_table_new (NULL, NULL);
+  self->background_web_views = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, 
(GDestroyNotify)gtk_widget_destroy);
   self->page_action_map = g_hash_table_new_full (NULL, NULL, NULL, (GDestroyNotify)g_hash_table_destroy);
   self->browser_action_map = g_hash_table_new_full (NULL, NULL, NULL, (GDestroyNotify)destroy_widget_list);
   self->web_extensions = NULL;
@@ -1068,6 +1068,7 @@ ephy_web_extension_manager_set_active (EphyWebExtensionManager *self,
       run_background_script (self, web_extension);
   } else {
     g_hash_table_remove (self->browser_action_map, web_extension);
+    g_hash_table_remove (self->background_web_views, web_extension);
   }
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]