[gnome-builder] plugins: Properly remove all the accelerators when unloading extensions



commit 05715856cf0fbcd48d666d751b919c2a3309f91d
Author: Mario Sanchez Prada <msanchez gnome org>
Date:   Sun Jan 24 22:41:10 2016 +0000

    plugins: Properly remove all the accelerators when unloading extensions
    
    Pass a NULL-terminated array to gtk_application_set_accels_for_action
    instead of simply passing NULL to avoid acrash in GtkApplication when
    unloading the devhelp and/or the terminal extensions.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=761064

 plugins/devhelp/gbp-devhelp-workbench-addin.c    |    3 ++-
 plugins/terminal/gb-terminal-application-addin.c |    4 +++-
 2 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/plugins/devhelp/gbp-devhelp-workbench-addin.c b/plugins/devhelp/gbp-devhelp-workbench-addin.c
index 032124e..2844720 100644
--- a/plugins/devhelp/gbp-devhelp-workbench-addin.c
+++ b/plugins/devhelp/gbp-devhelp-workbench-addin.c
@@ -104,6 +104,7 @@ gbp_devhelp_workbench_addin_unload (IdeWorkbenchAddin *addin,
   GbpDevhelpWorkbenchAddin *self = (GbpDevhelpWorkbenchAddin *)addin;
   IdePerspective *perspective;
   GtkWidget *pane;
+  const gchar *empty_accels[1] = { NULL };
 
   g_assert (IDE_IS_WORKBENCH_ADDIN (self));
   g_assert (IDE_IS_WORKBENCH (workbench));
@@ -121,7 +122,7 @@ gbp_devhelp_workbench_addin_unload (IdeWorkbenchAddin *addin,
   g_action_map_remove_action (G_ACTION_MAP (workbench), "focus-devhelp-search");
 
   gtk_application_set_accels_for_action (GTK_APPLICATION (IDE_APPLICATION_DEFAULT),
-                                         "win.focus-devhelp-search", NULL);
+                                         "win.focus-devhelp-search", empty_accels);
 }
 
 static void
diff --git a/plugins/terminal/gb-terminal-application-addin.c 
b/plugins/terminal/gb-terminal-application-addin.c
index 962207b..9467ce3 100644
--- a/plugins/terminal/gb-terminal-application-addin.c
+++ b/plugins/terminal/gb-terminal-application-addin.c
@@ -48,10 +48,12 @@ static void
 gb_terminal_application_addin_unload (IdeApplicationAddin *addin,
                                       IdeApplication      *application)
 {
+  const gchar *empty_accels[1] = { NULL };
+
   g_assert (GB_IS_TERMINAL_APPLICATION_ADDIN (addin));
   g_assert (IDE_IS_APPLICATION (application));
 
-  gtk_application_set_accels_for_action (GTK_APPLICATION (application), "win.new-terminal", NULL);
+  gtk_application_set_accels_for_action (GTK_APPLICATION (application), "win.new-terminal", empty_accels);
 }
 
 static void


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