diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2004-10-30 06:41:05 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2004-10-30 06:41:05 +0800 |
commit | c9ccac921537b68b5620b485848094a0ffecc3c1 (patch) | |
tree | 865ab706e15c948f8828581eeb1b27d5bcbee9f7 /src | |
parent | f0cae57f3be1b8ac61a09086dfe0eff1b8657013 (diff) | |
download | gsoc2013-epiphany-c9ccac921537b68b5620b485848094a0ffecc3c1.tar gsoc2013-epiphany-c9ccac921537b68b5620b485848094a0ffecc3c1.tar.gz gsoc2013-epiphany-c9ccac921537b68b5620b485848094a0ffecc3c1.tar.bz2 gsoc2013-epiphany-c9ccac921537b68b5620b485848094a0ffecc3c1.tar.lz gsoc2013-epiphany-c9ccac921537b68b5620b485848094a0ffecc3c1.tar.xz gsoc2013-epiphany-c9ccac921537b68b5620b485848094a0ffecc3c1.tar.zst gsoc2013-epiphany-c9ccac921537b68b5620b485848094a0ffecc3c1.zip |
Move idle unreffing to extensions manager. Makes sure that extensions are
2004-10-30 Christian Persch <chpe@cvs.gnome.org>
* lib/ephy-shlib-loader.c: (impl_release_object):
* src/ephy-extensions-manager.c: (idle_unref), (unload_extension):
Move idle unreffing to extensions manager. Makes sure that extensions
are finalised.
Diffstat (limited to 'src')
-rw-r--r-- | src/ephy-extensions-manager.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/ephy-extensions-manager.c b/src/ephy-extensions-manager.c index 3e79940dc..a940daca4 100644 --- a/src/ephy-extensions-manager.c +++ b/src/ephy-extensions-manager.c @@ -755,6 +755,14 @@ detach_window (EphyWindow *window, ephy_extension_detach_window (extension, window); } +static gboolean +idle_unref (GObject *object) +{ + g_object_unref (object); + + return FALSE; +} + static void unload_extension (EphyExtensionsManager *manager, ExtensionInfo *info) @@ -776,8 +784,15 @@ unload_extension (EphyExtensionsManager *manager, g_list_remove (manager->priv->extensions, info->extension); } + /* we own two refs to the extension, the one we added when + * we added it to the priv->extensions list, and the one returned + * from get_object. Release object, and queue a unref, since if the + * extension has its own functions queued in the idle loop, the + * functions must exist in memory before being called. + */ + g_idle_add ((GSourceFunc) idle_unref, info->extension); + ephy_loader_release_object (info->loader, G_OBJECT (info->extension)); - g_object_unref (info->extension); info->info.active = FALSE; info->extension = NULL; |