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
=== modified file 'panels/info/cc-info-panel.c'
--- panels/info/cc-info-panel.c 2014-02-20 17:15:24 +0000
+++ panels/info/cc-info-panel.c 2014-03-14 14:53:11 +0000
@@ -96,6 +96,7 @@
96struct _CcInfoPanelPrivate96struct _CcInfoPanelPrivate
97{97{
98 GtkBuilder *builder;98 GtkBuilder *builder;
99 GtkWidget *extra_options_dialog;
99 char *gnome_version;100 char *gnome_version;
100 char *gnome_distributor;101 char *gnome_distributor;
101 char *gnome_date;102 char *gnome_date;
@@ -464,29 +465,11 @@
464{465{
465 CcInfoPanelPrivate *priv = CC_INFO_PANEL (object)->priv;466 CcInfoPanelPrivate *priv = CC_INFO_PANEL (object)->priv;
466467
467 if (priv->builder != NULL)468 g_clear_object (&priv->builder);
468 {469 g_clear_object (&priv->pk_proxy);
469 g_object_unref (priv->builder);470 g_clear_object (&priv->pk_transaction_proxy);
470 priv->builder = NULL;471 g_clear_pointer (&priv->graphics_data, graphics_data_free);
471 }472 g_clear_pointer (&priv->extra_options_dialog, gtk_widget_destroy);
472
473 if (priv->pk_proxy != NULL)
474 {
475 g_object_unref (priv->pk_proxy);
476 priv->pk_proxy = NULL;
477 }
478
479 if (priv->pk_transaction_proxy != NULL)
480 {
481 g_object_unref (priv->pk_transaction_proxy);
482 priv->pk_transaction_proxy = NULL;
483 }
484
485 if (priv->graphics_data != NULL)
486 {
487 graphics_data_free (priv->graphics_data);
488 priv->graphics_data = NULL;
489 }
490473
491 G_OBJECT_CLASS (cc_info_panel_parent_class)->dispose (object);474 G_OBJECT_CLASS (cc_info_panel_parent_class)->dispose (object);
492}475}
@@ -1209,7 +1192,7 @@
1209 GtkWidget *dialog;1192 GtkWidget *dialog;
1210 GtkWidget *combo_box;1193 GtkWidget *combo_box;
12111194
1212 dialog = GTK_WIDGET (gtk_builder_get_object (self->priv->builder, "extra_options_dialog"));1195 dialog = self->priv->extra_options_dialog;
1213 combo_box = GTK_WIDGET (gtk_builder_get_object (self->priv->builder, "media_other_type_combobox"));1196 combo_box = GTK_WIDGET (gtk_builder_get_object (self->priv->builder, "media_other_type_combobox"));
1214 gtk_window_set_transient_for (GTK_WINDOW (dialog),1197 gtk_window_set_transient_for (GTK_WINDOW (dialog),
1215 GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (self))));1198 GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (self))));
@@ -1715,8 +1698,7 @@
1715 }1698 }
1716 else if (g_strcmp0 (signal_name, "Destroy") == 0)1699 else if (g_strcmp0 (signal_name, "Destroy") == 0)
1717 {1700 {
1718 g_object_unref (self->priv->pk_transaction_proxy);1701 g_clear_object (&self->priv->pk_transaction_proxy);
1719 self->priv->pk_transaction_proxy = NULL;
1720 }1702 }
1721}1703}
17221704
@@ -1940,6 +1922,8 @@
1940 return;1922 return;
1941 }1923 }
19421924
1925 self->priv->extra_options_dialog = WID ("extra_options_dialog");
1926
1943 self->priv->graphics_data = get_graphics_data ();1927 self->priv->graphics_data = get_graphics_data ();
19441928
1945 widget = WID ("updates_button");1929 widget = WID ("updates_button");
19461930
=== modified file 'panels/keyboard/keyboard-shortcuts.c'
--- panels/keyboard/keyboard-shortcuts.c 2013-11-29 06:28:37 +0000
+++ panels/keyboard/keyboard-shortcuts.c 2014-03-14 14:53:11 +0000
@@ -1893,5 +1893,7 @@
18931893
1894 g_clear_object (&binding_settings);1894 g_clear_object (&binding_settings);
18951895
1896 g_clear_pointer (&custom_shortcut_dialog, gtk_widget_destroy);
1897
1896 cc_keyboard_option_clear_all ();1898 cc_keyboard_option_clear_all ();
1897}1899}
18981900
=== modified file 'panels/user-accounts/um-account-dialog.c'
--- panels/user-accounts/um-account-dialog.c 2014-02-21 15:48:18 +0000
+++ panels/user-accounts/um-account-dialog.c 2014-03-14 14:53:11 +0000
@@ -1192,6 +1192,8 @@
1192 self->realm_manager = NULL;1192 self->realm_manager = NULL;
1193 }1193 }
11941194
1195 g_clear_pointer (&self->join_dialog, gtk_widget_destroy);
1196
1195 G_OBJECT_CLASS (um_account_dialog_parent_class)->dispose (obj);1197 G_OBJECT_CLASS (um_account_dialog_parent_class)->dispose (obj);
1196}1198}
11971199

Subscribers

People subscribed via source and target branches