[evolution-data-server] EDataBookFactory: Always watch sender's bus name.



commit 4d6059c699986d07b414c904d7e1330f7bc32e8f
Author: Matthew Barnes <mbarnes redhat com>
Date:   Thu Aug 15 15:23:20 2013 -0400

    EDataBookFactory: Always watch sender's bus name.
    
    Watch the sender's bus name on every new connection so we can clean up
    its connections if the bus name vanishes (e.g. client program crashes).
    
    Previously we were only watching the sender's bus name if the backend
    instance was created for that connection, but that was unintentional.

 addressbook/libedata-book/e-data-book-factory.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/addressbook/libedata-book/e-data-book-factory.c b/addressbook/libedata-book/e-data-book-factory.c
index bb8321c..1e1b2ec 100644
--- a/addressbook/libedata-book/e-data-book-factory.c
+++ b/addressbook/libedata-book/e-data-book-factory.c
@@ -335,9 +335,6 @@ data_book_factory_open (EDataBookFactory *factory,
                        connection, object_path, error);
 
                if (data_book != NULL) {
-                       data_book_factory_watched_names_add (
-                               factory, connection, sender);
-
                        g_signal_connect_object (
                                backend, "closed",
                                G_CALLBACK (data_book_factory_closed_cb),
@@ -350,6 +347,11 @@ data_book_factory_open (EDataBookFactory *factory,
        }
 
        if (data_book != NULL) {
+               /* Watch the sender's bus name so we can clean
+                * up its connections if the bus name vanishes. */
+               data_book_factory_watched_names_add (
+                       factory, connection, sender);
+
                /* A client may create multiple EClient instances for the
                 * same ESource, each of which calls close() individually.
                 * So we must track each and every connection made. */


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