[libpeas] Fix not emitting notify::loaded-plugins when PeasEngine is being destroyed
- From: Steve Frécinaux <sfre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libpeas] Fix not emitting notify::loaded-plugins when PeasEngine is being destroyed
- Date: Wed, 15 Dec 2010 19:41:25 +0000 (UTC)
commit d417aea4b3904d4ee7c54fbb8751c5a4b3b41878
Author: Garrett Regier <alias301 gmail com>
Date: Tue Dec 14 11:35:39 2010 -0800
Fix not emitting notify::loaded-plugins when PeasEngine is being destroyed
libpeas/peas-engine.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/libpeas/peas-engine.c b/libpeas/peas-engine.c
index 299ae9a..a882761 100644
--- a/libpeas/peas-engine.c
+++ b/libpeas/peas-engine.c
@@ -92,6 +92,8 @@ struct _PeasEnginePrivate {
GList *plugin_list;
GHashTable *loaders;
+
+ guint in_dispose : 1;
};
static void peas_engine_load_plugin_real (PeasEngine *engine,
@@ -309,6 +311,8 @@ peas_engine_init (PeasEngine *engine)
PEAS_TYPE_ENGINE,
PeasEnginePrivate);
+ engine->priv->in_dispose = FALSE;
+
/* mapping from loadername -> loader object */
engine->priv->loaders = g_hash_table_new_full (hash_lowercase,
(GEqualFunc) equal_lowercase,
@@ -397,6 +401,8 @@ peas_engine_dispose (GObject *object)
PeasEngine *engine = PEAS_ENGINE (object);
GList *item;
+ engine->priv->in_dispose = TRUE;
+
/* First unload all the plugins */
for (item = engine->priv->plugin_list; item; item = item->next)
{
@@ -866,7 +872,8 @@ peas_engine_unload_plugin_real (PeasEngine *engine,
peas_plugin_loader_garbage_collect (loader);
peas_plugin_loader_unload (loader, info);
- g_object_notify (G_OBJECT (engine), "loaded-plugins");
+ if (!engine->priv->in_dispose)
+ g_object_notify (G_OBJECT (engine), "loaded-plugins");
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]