Merge lp:~seb128/unity-control-center/dont-leak-dialog into lp:unity-control-center

Proposed by Sebastien Bacher
Status: Merged
Approved by: Robert Ancell
Approved revision: 12752
Merged at revision: 12752
Proposed branch: lp:~seb128/unity-control-center/dont-leak-dialog
Merge into: lp:unity-control-center
Diff against target: 98 lines (+14/-26)
3 files modified
panels/info/cc-info-panel.c (+10/-26)
panels/keyboard/keyboard-shortcuts.c (+2/-0)
panels/user-accounts/um-account-dialog.c (+2/-0)
To merge this branch: bzr merge lp:~seb128/unity-control-center/dont-leak-dialog
Reviewer Review Type Date Requested Status
Robert Ancell Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+211064@code.launchpad.net

Commit message

Backport some leak fixes from upstream, those were leading to dialogs
not closing when they should (e.g when exiting the panel they belong to),
hitting a segfault when used then.

Description of the change

Backport some leak fixes from upstream, those were leading to dialogs
not closing when they should (e.g when exiting the panel they belong to),
hitting a segfault when used then.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Robert Ancell (robert-ancell) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'panels/info/cc-info-panel.c'
2--- panels/info/cc-info-panel.c 2014-02-20 17:15:24 +0000
3+++ panels/info/cc-info-panel.c 2014-03-14 14:53:11 +0000
4@@ -96,6 +96,7 @@
5 struct _CcInfoPanelPrivate
6 {
7 GtkBuilder *builder;
8+ GtkWidget *extra_options_dialog;
9 char *gnome_version;
10 char *gnome_distributor;
11 char *gnome_date;
12@@ -464,29 +465,11 @@
13 {
14 CcInfoPanelPrivate *priv = CC_INFO_PANEL (object)->priv;
15
16- if (priv->builder != NULL)
17- {
18- g_object_unref (priv->builder);
19- priv->builder = NULL;
20- }
21-
22- if (priv->pk_proxy != NULL)
23- {
24- g_object_unref (priv->pk_proxy);
25- priv->pk_proxy = NULL;
26- }
27-
28- if (priv->pk_transaction_proxy != NULL)
29- {
30- g_object_unref (priv->pk_transaction_proxy);
31- priv->pk_transaction_proxy = NULL;
32- }
33-
34- if (priv->graphics_data != NULL)
35- {
36- graphics_data_free (priv->graphics_data);
37- priv->graphics_data = NULL;
38- }
39+ g_clear_object (&priv->builder);
40+ g_clear_object (&priv->pk_proxy);
41+ g_clear_object (&priv->pk_transaction_proxy);
42+ g_clear_pointer (&priv->graphics_data, graphics_data_free);
43+ g_clear_pointer (&priv->extra_options_dialog, gtk_widget_destroy);
44
45 G_OBJECT_CLASS (cc_info_panel_parent_class)->dispose (object);
46 }
47@@ -1209,7 +1192,7 @@
48 GtkWidget *dialog;
49 GtkWidget *combo_box;
50
51- dialog = GTK_WIDGET (gtk_builder_get_object (self->priv->builder, "extra_options_dialog"));
52+ dialog = self->priv->extra_options_dialog;
53 combo_box = GTK_WIDGET (gtk_builder_get_object (self->priv->builder, "media_other_type_combobox"));
54 gtk_window_set_transient_for (GTK_WINDOW (dialog),
55 GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (self))));
56@@ -1715,8 +1698,7 @@
57 }
58 else if (g_strcmp0 (signal_name, "Destroy") == 0)
59 {
60- g_object_unref (self->priv->pk_transaction_proxy);
61- self->priv->pk_transaction_proxy = NULL;
62+ g_clear_object (&self->priv->pk_transaction_proxy);
63 }
64 }
65
66@@ -1940,6 +1922,8 @@
67 return;
68 }
69
70+ self->priv->extra_options_dialog = WID ("extra_options_dialog");
71+
72 self->priv->graphics_data = get_graphics_data ();
73
74 widget = WID ("updates_button");
75
76=== modified file 'panels/keyboard/keyboard-shortcuts.c'
77--- panels/keyboard/keyboard-shortcuts.c 2013-11-29 06:28:37 +0000
78+++ panels/keyboard/keyboard-shortcuts.c 2014-03-14 14:53:11 +0000
79@@ -1893,5 +1893,7 @@
80
81 g_clear_object (&binding_settings);
82
83+ g_clear_pointer (&custom_shortcut_dialog, gtk_widget_destroy);
84+
85 cc_keyboard_option_clear_all ();
86 }
87
88=== modified file 'panels/user-accounts/um-account-dialog.c'
89--- panels/user-accounts/um-account-dialog.c 2014-02-21 15:48:18 +0000
90+++ panels/user-accounts/um-account-dialog.c 2014-03-14 14:53:11 +0000
91@@ -1192,6 +1192,8 @@
92 self->realm_manager = NULL;
93 }
94
95+ g_clear_pointer (&self->join_dialog, gtk_widget_destroy);
96+
97 G_OBJECT_CLASS (um_account_dialog_parent_class)->dispose (obj);
98 }
99

Subscribers

People subscribed via source and target branches