[gnome-control-center] background: only reset item_added_id when the source is removed



commit 9d1d8534b8e82d143e84a07ea7ea8fa4cf078567
Author: Thomas Wood <thos gnome org>
Date:   Sat Feb 19 17:25:20 2011 +0000

    background: only reset item_added_id when the source is removed
    
    Make sure item_added_id is set to zero only when the idle source id is
    actually removed. This ensures that the source is removed during finalize
    if it still exists when the object is destroyed.

 panels/background/cc-background-xml.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/panels/background/cc-background-xml.c b/panels/background/cc-background-xml.c
index 0538145..4aa0ab9 100644
--- a/panels/background/cc-background-xml.c
+++ b/panels/background/cc-background-xml.c
@@ -126,10 +126,14 @@ idle_emit (CcBackgroundXml *xml)
 		i--;
 	}
 
-	xml->priv->item_added_id = 0;
 	g_async_queue_unlock (xml->priv->item_added_queue);
 
-	return (g_async_queue_length (xml->priv->item_added_queue) > 0);
+        if (g_async_queue_length (xml->priv->item_added_queue) > 0) {
+                return TRUE;
+        } else {
+                xml->priv->item_added_id = 0;
+                return FALSE;
+        }
 }
 
 static void



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