[gnome-color-manager] trivial: ensure we retain a reference when we remove profiles from the store to avoid a critical war



commit 666f2c7ff9662f88be0f8efd6fc843519b9bd47a
Author: Richard Hughes <richard hughsie com>
Date:   Fri Jun 25 10:36:03 2010 +0100

    trivial: ensure we retain a reference when we remove profiles from the store to avoid a critical warning

 src/gcm-profile-store.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/src/gcm-profile-store.c b/src/gcm-profile-store.c
index aeda5bd..c165ebb 100644
--- a/src/gcm-profile-store.c
+++ b/src/gcm-profile-store.c
@@ -178,6 +178,9 @@ gcm_profile_store_remove_profile (GcmProfileStore *profile_store, GcmProfile *pr
 	gboolean ret;
 	GcmProfileStorePrivate *priv = profile_store->priv;
 
+	/* grab a temporary reference on this profile */
+	g_object_ref (profile);
+
 	/* remove from list */
 	ret = g_ptr_array_remove (priv->profile_array, profile);
 	if (!ret) {
@@ -186,10 +189,11 @@ gcm_profile_store_remove_profile (GcmProfileStore *profile_store, GcmProfile *pr
 	}
 
 	/* emit a signal */
-	egg_debug ("emit removed (and changed): %s", gcm_profile_get_filename (profile));
+	egg_debug ("emit removed (and changed): %s", gcm_profile_get_checksum (profile));
 	g_signal_emit (profile_store, signals[SIGNAL_REMOVED], 0, profile);
 	g_signal_emit (profile_store, signals[SIGNAL_CHANGED], 0);
 out:
+	g_object_unref (profile);
 	return ret;
 }
 



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