[network-manager-applet] libnm-gtk: fix crash when internal_init() fails
- From: JiÅÃ KlimeÅ <jklimes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [network-manager-applet] libnm-gtk: fix crash when internal_init() fails
- Date: Fri, 20 Jul 2012 12:31:55 +0000 (UTC)
commit 24084a4a4068248e2dc18aed5417df428ff06505
Author: JiÅÃ KlimeÅ <jklimes redhat com>
Date: Fri Jul 20 13:59:27 2012 +0200
libnm-gtk: fix crash when internal_init() fails
While destroying widget with g_object_unref(), the object was unrefed twice, once
in gtk_widget_dispose() and second time in g_object_unref() where sigsegv happened.
gtk_widget_destroy() fixes that.
This was the stacktrace:
-------------------------------------------------------------------------------
** Message: No keyring secrets found for abcd/802-11-wireless-security; asking user.
** (nm-applet:29260): WARNING **: No wireless devices available.
** (nm-applet:29260): WARNING **: Couldn't create wireless security dialog.
(nm-applet:29260): GLib-GObject-WARNING **: instance with invalid (NULL) class pointer
(nm-applet:29260): GLib-GObject-CRITICAL **: g_signal_handlers_destroy: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed
(nm-applet:29260): GLib-GObject-WARNING **: instance with invalid (NULL) class pointer
(nm-applet:29260): GLib-GObject-CRITICAL **: g_signal_handlers_destroy: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed
Program received signal SIGSEGV, Segmentation fault.
0x0000003d91411469 in g_object_unref (_object=0xd3f010) at gobject.c:2740
2740 TRACE (GOBJECT_OBJECT_UNREF(object,G_TYPE_FROM_INSTANCE(object),old_ref));
(gdb) bt
#0 0x0000003d91411469 in g_object_unref (_object=0xd3f010) at gobject.c:2740
#1 0x00007ffff7da7a63 in nma_wireless_dialog_new (client=0x736310 [NMClient], settings=0x72fd30 [NMRemoteSettings], connection=0xafb2a0 [NMConnection], device=0x0, ap=0x0, secrets_only=1)
at nm-wireless-dialog.c:1313
#2 0x0000000000429063 in wireless_get_secrets (req=0x97f600, error=0x7fffffffd6a8) at applet-device-wifi.c:1674
#3 0x0000000000419179 in get_existing_secrets_cb (agent=0x72fdb0 [AppletAgent], connection=0xafb2a0 [NMConnection], secrets=0xd33640, secrets_error=0x0, user_data=0x97f600) at applet.c:2834
#4 0x000000000041bea7 in keyring_find_secrets_cb (result=GNOME_KEYRING_RESULT_NO_MATCH, list=0x0, user_data=0x8068a0) at applet-agent.c:426
#5 0x00000037c2208b66 in on_complete (op=0xd38860) at gkr-operation.c:239
#6 0x00000037c2210a1d in find_items_1_reply (data=0x8706c0, reply=0xaf8af0, op=0xd38860) at gnome-keyring.c:2370
#7 find_items_1_reply (op=0xd38860, reply=0xaf8af0, data=0x8706c0) at gnome-keyring.c:2348
#8 0x00000037c2209aa1 in on_pending_call_notify (pending=<optimized out>, user_data=0xd38860) at gkr-operation.c:400
#9 0x00000037c160c3ea in ?? () from /lib64/libdbus-1.so.3
#10 0x00000037c160f67a in dbus_connection_dispatch () from /lib64/libdbus-1.so.3
#11 0x00000037c2214af5 in message_queue_dispatch (source=<optimized out>, callback=<optimized out>, user_data=<optimized out>) at egg-dbus.c:75
#12 0x0000003d8f044f3d in g_main_dispatch (context=0x6adaa0) at gmain.c:2441
#13 g_main_context_dispatch (context=0x6adaa0) at gmain.c:3011
#14 0x0000003d8f045738 in g_main_context_iterate (context=0x6adaa0, block=<optimized out>, dispatch=1, self=<optimized out>) at gmain.c:3089
#15 0x0000003d8f045c85 in g_main_loop_run (loop=0x6b18d0) at gmain.c:3297
#16 0x0000000000411c06 in main (argc=1, argv=0x7fffffffdb68) at main.c:106
(gdb)
-------------------------------------------------------------------------------
src/libnm-gtk/nm-wireless-dialog.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/libnm-gtk/nm-wireless-dialog.c b/src/libnm-gtk/nm-wireless-dialog.c
index 73feb81..27dc951 100644
--- a/src/libnm-gtk/nm-wireless-dialog.c
+++ b/src/libnm-gtk/nm-wireless-dialog.c
@@ -1304,7 +1304,7 @@ nma_wireless_dialog_new (NMClient *client,
if (!internal_init (NMA_WIRELESS_DIALOG (obj), connection, device, secrets_only, FALSE)) {
g_warning ("Couldn't create wireless security dialog.");
- g_object_unref (obj);
+ gtk_widget_destroy (GTK_WIDGET (obj));
obj = NULL;
}
}
@@ -1335,7 +1335,7 @@ internal_new_other (NMClient *client, NMRemoteSettings *settings, gboolean creat
if (!internal_init (self, NULL, NULL, FALSE, create)) {
g_warning ("Couldn't create wireless security dialog.");
- g_object_unref (self);
+ gtk_widget_destroy (GTK_WIDGET (self));
return NULL;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]