[network-manager-applet/nma-1-0] libnm-gtk: fix a possible crash on widgets destroy (rh #1254043)
- From: Jiří Klimeš <jklimes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [network-manager-applet/nma-1-0] libnm-gtk: fix a possible crash on widgets destroy (rh #1254043)
- Date: Mon, 31 Aug 2015 14:06:58 +0000 (UTC)
commit 6ee38dd8fb792a944ea597c9eba21f382d9c4836
Author: Jiří Klimeš <jklimes redhat com>
Date: Mon Aug 31 15:42:13 2015 +0200
libnm-gtk: fix a possible crash on widgets destroy (rh #1254043)
https://bugzilla.redhat.com/show_bug.cgi?id=1254043
(cherry picked from commit 0d0e84316f5db87b4909f09060c596dfe48a69e7)
src/libnm-gtk/nm-ui-utils.c | 15 ++++++---------
1 files changed, 6 insertions(+), 9 deletions(-)
---
diff --git a/src/libnm-gtk/nm-ui-utils.c b/src/libnm-gtk/nm-ui-utils.c
index 9119deb..138bbea 100644
--- a/src/libnm-gtk/nm-ui-utils.c
+++ b/src/libnm-gtk/nm-ui-utils.c
@@ -730,13 +730,13 @@ typedef struct {
} PopupMenuItemInfo;
static void
-popup_menu_item_info_destroy (gpointer data)
+popup_menu_item_info_destroy (gpointer data, GClosure *closure)
{
PopupMenuItemInfo *info = (PopupMenuItemInfo *) data;
if (info->setting)
g_object_unref (info->setting);
- g_slice_free (PopupMenuItemInfo, data);
+ g_slice_free (PopupMenuItemInfo, info);
}
static void
@@ -824,11 +824,8 @@ nma_utils_setup_password_storage (GtkWidget *passwd_entry,
if (with_not_required)
gtk_menu_shell_append (GTK_MENU_SHELL (popup_menu), item[3]);
- if (setting)
- g_object_ref (setting);
-
info = g_slice_new0 (PopupMenuItemInfo);
- info->setting = setting;
+ info->setting = setting ? g_object_ref (setting) : NULL;
info->password_flags_name = password_flags_name;
info->item_number = ITEM_STORAGE_USER;
info->passwd_entry = passwd_entry;
@@ -838,7 +835,7 @@ nma_utils_setup_password_storage (GtkWidget *passwd_entry,
(GClosureNotify) popup_menu_item_info_destroy, 0);
info = g_slice_new0 (PopupMenuItemInfo);
- info->setting = setting;
+ info->setting = setting ? g_object_ref (setting) : NULL;
info->password_flags_name = password_flags_name;
info->item_number = ITEM_STORAGE_SYSTEM;
info->passwd_entry = passwd_entry;
@@ -848,7 +845,7 @@ nma_utils_setup_password_storage (GtkWidget *passwd_entry,
(GClosureNotify) popup_menu_item_info_destroy, 0);
info = g_slice_new0 (PopupMenuItemInfo);
- info->setting = setting;
+ info->setting = setting ? g_object_ref (setting) : NULL;
info->password_flags_name = password_flags_name;
info->item_number = ITEM_STORAGE_ASK;
info->passwd_entry = passwd_entry;
@@ -860,7 +857,7 @@ nma_utils_setup_password_storage (GtkWidget *passwd_entry,
if (with_not_required) {
info = g_slice_new0 (PopupMenuItemInfo);
- info->setting = setting;
+ info->setting = setting ? g_object_ref (setting) : NULL;
info->password_flags_name = password_flags_name;
info->item_number = ITEM_STORAGE_UNUSED;
info->passwd_entry = passwd_entry;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]