[network-manager-applet/bg/fix-editor-crash: 2/2] editor: register to the connection-removed signal only once



commit 9272d54a67700c9f8f212db2eb4dcd8404bb94a4
Author: Beniamino Galvani <bgalvani redhat com>
Date:   Mon Jun 24 15:25:15 2019 +0200

    editor: register to the connection-removed signal only once
    
    The callback was called multiple times for a single removal because it
    was registered multiple times.
    
    Fixes: 4d7546e7d0e56c3a102a12ba03695eac6f8109f8

 src/connection-editor/nm-connection-list.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/src/connection-editor/nm-connection-list.c b/src/connection-editor/nm-connection-list.c
index ad1bde97..6e23eb26 100644
--- a/src/connection-editor/nm-connection-list.c
+++ b/src/connection-editor/nm-connection-list.c
@@ -981,7 +981,6 @@ connection_added (NMClient *client,
                gtk_tree_path_free (path);
        }
 
-       g_signal_connect (client, NM_CLIENT_CONNECTION_REMOVED, G_CALLBACK (connection_removed), self);
        g_signal_connect (connection, NM_CONNECTION_CHANGED, G_CALLBACK (connection_changed), self);
        gtk_tree_model_filter_refilter (priv->filter);
 }
@@ -1011,6 +1010,10 @@ nm_connection_list_new (void)
                          NM_CLIENT_CONNECTION_ADDED,
                          G_CALLBACK (connection_added),
                          list);
+       g_signal_connect (priv->client,
+                         NM_CLIENT_CONNECTION_REMOVED,
+                         G_CALLBACK (connection_removed),
+                         list);
 
        add_connection_buttons (list);
        initialize_treeview (list);


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