[gnome-control-center] online-accounts: Fix crash after aborting web view and changing panels



commit 60cf7f6b2703e3e89aedac0684ab0e7ae09ce86e
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Wed Aug 16 18:53:33 2017 -0300

    online-accounts: Fix crash after aborting web view and changing panels
    
    The panel owns both the GtkDialog, and the GoaProvider that is used
    with the dialog during goa_provider_add_account. When the panel is
    destroyed, it drops its references to the provider but not the dialog,
    which is a separate top-level widget. Therefore, if the panel is
    switched while the WebKitWebView inside the dialog was still
    navigating across pages, then WebKitWebView::decide-policy will be
    called with an invalid provider.
    
    To avoid this, and a memory leak, the panel should also destroy the
    dialog when it is itself getting destructed.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=782043

 panels/online-accounts/cc-online-accounts-panel.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
---
diff --git a/panels/online-accounts/cc-online-accounts-panel.c 
b/panels/online-accounts/cc-online-accounts-panel.c
index 04063d8..00fc7a4 100644
--- a/panels/online-accounts/cc-online-accounts-panel.c
+++ b/panels/online-accounts/cc-online-accounts-panel.c
@@ -388,6 +388,7 @@ cc_goa_panel_finalize (GObject *object)
   CcGoaPanel *panel = CC_GOA_PANEL (object);
 
   g_clear_object (&panel->client);
+  g_clear_pointer (&panel->edit_account_dialog, gtk_widget_destroy);
 
   G_OBJECT_CLASS (cc_goa_panel_parent_class)->finalize (object);
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]