[evolution-data-server] source_idle_changed_cb: Avoid a runtime warning.



commit 16ddd93422b21d859be6dd80278731180e75f9df
Author: Matthew Barnes <mbarnes redhat com>
Date:   Thu Jun 21 13:21:56 2012 -0400

    source_idle_changed_cb: Avoid a runtime warning.
    
    Apparently it's possible for the 'changed' GSource to already be NULL
    when we go to unref it in source_idle_changed_cb().  Not sure how that's
    happening... possibly racing with dispose()?  In any case just check for
    NULL first.

 libedataserver/e-source.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/libedataserver/e-source.c b/libedataserver/e-source.c
index 8538aed..b624bff 100644
--- a/libedataserver/e-source.c
+++ b/libedataserver/e-source.c
@@ -629,8 +629,10 @@ source_idle_changed_cb (gpointer user_data)
 	ESource *source = E_SOURCE (user_data);
 
 	g_mutex_lock (source->priv->changed_lock);
-	g_source_unref (source->priv->changed);
-	source->priv->changed = NULL;
+	if (source->priv->changed != NULL) {
+		g_source_unref (source->priv->changed);
+		source->priv->changed = NULL;
+	}
 	g_mutex_unlock (source->priv->changed_lock);
 
 	g_signal_emit (source, signals[CHANGED], 0);



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