[network-manager-applet] applet: fix errors when calling wireless_dialog_close() on destroyed dialog
- From: Jiří Klimeš <jklimes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [network-manager-applet] applet: fix errors when calling wireless_dialog_close() on destroyed dialog
- Date: Thu, 5 Aug 2010 14:09:51 +0000 (UTC)
commit a434df70f13c010e418036ba1235ac757eacd6b2
Author: JiÅ?à KlimeÅ¡ <jklimes redhat com>
Date: Thu Aug 5 16:05:15 2010 +0200
applet: fix errors when calling wireless_dialog_close() on destroyed dialog
Case: When connecting to WPA EAP network, don't specify CA cert, click
'Connect', on poping dialog click 'Choose CA cert', then again 'Connect'
(can be repeated more times). And now click 'Ignore'. The connection is
established, but errors are issued.
src/applet-device-wifi.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/applet-device-wifi.c b/src/applet-device-wifi.c
index 0821e7f..8548d4b 100644
--- a/src/applet-device-wifi.c
+++ b/src/applet-device-wifi.c
@@ -1357,6 +1357,13 @@ wireless_dialog_close (gpointer user_data)
}
static void
+wireless_dialog_destroyed (gpointer data, GObject *dialog_ptr)
+{
+ /* remove the idle function; for not to call wireless_dialog_close() on invalid pointer */
+ g_idle_remove_by_data (dialog_ptr);
+}
+
+static void
nag_dialog_response_cb (GtkDialog *nag_dialog,
gint response,
gpointer user_data)
@@ -1366,6 +1373,7 @@ nag_dialog_response_cb (GtkDialog *nag_dialog,
if (response == GTK_RESPONSE_NO) { /* user opted not to correct the warning */
nma_wireless_dialog_set_nag_ignored (wireless_dialog, TRUE);
g_idle_add (wireless_dialog_close, wireless_dialog);
+ g_object_weak_ref (G_OBJECT (wireless_dialog), wireless_dialog_destroyed, NULL);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]