[network-manager-applet] editor: fix calling connections_read() on freed data (rh #706906)
- From: Jiří Klimeš <jklimes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [network-manager-applet] editor: fix calling connections_read() on freed data (rh #706906)
- Date: Tue, 7 Jun 2011 12:16:42 +0000 (UTC)
commit 04dd20c9994f3839b6713a0f936687278ca10ca6
Author: JiÅ?à KlimeÅ¡ <jklimes redhat com>
Date: Tue Jun 7 14:08:05 2011 +0200
editor: fix calling connections_read() on freed data (rh #706906)
src/connection-editor/nm-connection-list.c | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/src/connection-editor/nm-connection-list.c b/src/connection-editor/nm-connection-list.c
index ff459fd..0d65aed 100644
--- a/src/connection-editor/nm-connection-list.c
+++ b/src/connection-editor/nm-connection-list.c
@@ -1545,8 +1545,9 @@ static void
connections_read (NMRemoteSettings *settings, EditData *data)
{
NMConnection *connection;
+ static gulong signal_id = 0;
- connection = get_connection (data->self->settings, data->uuid);
+ connection = get_connection (settings, data->uuid);
if (connection) {
NMSettingConnection *s_con;
const char *type;
@@ -1566,8 +1567,8 @@ connections_read (NMRemoteSettings *settings, EditData *data)
g_object_unref (connection);
} else if (data->wait) {
data->wait = FALSE;
- g_signal_connect (data->self->settings, "connections-read",
- G_CALLBACK (connections_read), data);
+ signal_id = g_signal_connect (settings, "connections-read",
+ G_CALLBACK (connections_read), data);
return;
} else {
error_dialog (NULL,
@@ -1575,6 +1576,11 @@ connections_read (NMRemoteSettings *settings, EditData *data)
_("Did not find a connection with UUID '%s'"), data->uuid);
}
+ if (signal_id != 0) {
+ g_signal_handler_disconnect (settings, signal_id);
+ signal_id = 0;
+ }
+
g_free (data);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]