summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2013-08-14 09:00:58 +0100
committerRichard Hughes <richard@hughsie.com>2013-08-14 09:01:05 +0100
commit2cb334172382268786b50057d463aad4757c82b0 (patch)
tree873eadf0f5a2c04ccf96904000e6abd86665d6d8
parentc7c32250c4809f82b6c67198dbe848299d8df011 (diff)
downloadcolord-2cb334172382268786b50057d463aad4757c82b0.tar.gz
libcolord: Do not assert on finalize if connecting to the profile failed
If we create a profile and delete it very quickly afterwards, the client may not have time to connect and retrieve all the properties. In this case it returns without connecting up the signals. If this happens, we assert when we finalize the object as we explicitly check for success. This fixes xiccd crashing when running 'make check' in the colord project.
-rw-r--r--lib/colord/cd-profile.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/lib/colord/cd-profile.c b/lib/colord/cd-profile.c
index 39690c8..84a8e91 100644
--- a/lib/colord/cd-profile.c
+++ b/lib/colord/cd-profile.c
@@ -1527,7 +1527,6 @@ static void
cd_profile_finalize (GObject *object)
{
CdProfile *profile;
- guint ret;
g_return_if_fail (CD_IS_PROFILE (object));
@@ -1542,14 +1541,12 @@ cd_profile_finalize (GObject *object)
g_free (profile->priv->title);
g_strfreev (profile->priv->warnings);
if (profile->priv->proxy != NULL) {
- ret = g_signal_handlers_disconnect_by_func (profile->priv->proxy,
- G_CALLBACK (cd_profile_dbus_signal_cb),
- profile);
- g_assert (ret > 0);
- ret = g_signal_handlers_disconnect_by_func (profile->priv->proxy,
- G_CALLBACK (cd_profile_dbus_properties_changed_cb),
- profile);
- g_assert (ret > 0);
+ g_signal_handlers_disconnect_by_func (profile->priv->proxy,
+ G_CALLBACK (cd_profile_dbus_signal_cb),
+ profile);
+ g_signal_handlers_disconnect_by_func (profile->priv->proxy,
+ G_CALLBACK (cd_profile_dbus_properties_changed_cb),
+ profile);
g_object_unref (profile->priv->proxy);
}