[libpeas] Fix emitting PeasExtensionSet::extension-removed
- From: Garrett Regier <gregier src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libpeas] Fix emitting PeasExtensionSet::extension-removed
- Date: Thu, 9 Dec 2010 17:40:17 +0000 (UTC)
commit 07341143aa598571a5baa2530a02b9a7b668e5fb
Author: Garrett Regier <alias301 gmail com>
Date: Thu Dec 9 09:35:30 2010 -0800
Fix emitting PeasExtensionSet::extension-removed
Before is was not emitted when the extension set was being
finalized because signals are not emitted in finalize but are in dispose.
libpeas/peas-extension-set.c | 25 ++++++++++++++++++++-----
1 files changed, 20 insertions(+), 5 deletions(-)
---
diff --git a/libpeas/peas-extension-set.c b/libpeas/peas-extension-set.c
index f9ac8df..6ed7ba0 100644
--- a/libpeas/peas-extension-set.c
+++ b/libpeas/peas-extension-set.c
@@ -288,13 +288,22 @@ peas_extension_set_constructed (GObject *object)
}
static void
-peas_extension_set_finalize (GObject *object)
+peas_extension_set_dispose (GObject *object)
{
PeasExtensionSet *set = PEAS_EXTENSION_SET (object);
GList *l;
- g_signal_handler_disconnect (set->priv->engine, set->priv->load_handler_id);
- g_signal_handler_disconnect (set->priv->engine, set->priv->unload_handler_id);
+ if (set->priv->load_handler_id != 0)
+ {
+ g_signal_handler_disconnect (set->priv->engine, set->priv->load_handler_id);
+ set->priv->load_handler_id = 0;
+ }
+
+ if (set->priv->unload_handler_id != 0)
+ {
+ g_signal_handler_disconnect (set->priv->engine, set->priv->unload_handler_id);
+ set->priv->unload_handler_id = 0;
+ }
for (l = set->priv->extensions; l;)
{
@@ -306,10 +315,16 @@ peas_extension_set_finalize (GObject *object)
{
while (set->priv->n_parameters-- > 0)
g_value_unset (&set->priv->parameters[set->priv->n_parameters].value);
+
g_free (set->priv->parameters);
+ set->priv->parameters = NULL;
}
- g_object_unref (set->priv->engine);
+ if (set->priv->engine != NULL)
+ {
+ g_object_unref (set->priv->engine);
+ set->priv->engine = NULL;
+ }
}
static gboolean
@@ -339,7 +354,7 @@ peas_extension_set_class_init (PeasExtensionSetClass *klass)
object_class->set_property = peas_extension_set_set_property;
object_class->get_property = peas_extension_set_get_property;
object_class->constructed = peas_extension_set_constructed;
- object_class->finalize = peas_extension_set_finalize;
+ object_class->dispose = peas_extension_set_dispose;
klass->call = peas_extension_set_call_real;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]