=?utf-8?q?=5Bfolks=5D_eds=3A_Don=E2=80=99t_try_and_remove_a_non-existent_?= =?utf-8?q?timeout_source?=



commit d7b8ccbe27d0a1ff3e9ed291e04ba18a86d5f89f
Author: Philip Withnall <philip tecnocode co uk>
Date:   Tue Apr 17 12:56:11 2012 +0100

    eds: Donât try and remove a non-existent timeout source
    
    In the case that the modify_contact() call fails, timeout_id will equal 0,
    and GLib will complain when we try to remove it in the finally{} block.

 backends/eds/lib/edsf-persona-store.vala |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/backends/eds/lib/edsf-persona-store.vala b/backends/eds/lib/edsf-persona-store.vala
index 1ac7da3..4fa5b97 100644
--- a/backends/eds/lib/edsf-persona-store.vala
+++ b/backends/eds/lib/edsf-persona-store.vala
@@ -1261,8 +1261,15 @@ public class Edsf.PersonaStore : Folks.PersonaStore
       finally
         {
           /* Remove the callbacks. */
-          persona.disconnect (signal_id);
-          GLib.Source.remove (timeout_id);
+          if (signal_id != 0)
+            {
+              persona.disconnect (signal_id);
+            }
+
+          if (timeout_id != 0)
+            {
+              GLib.Source.remove (timeout_id);
+            }
         }
     }
 



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