[gnome-builder/wip/chergert/static-link: 2/2] beautifier: fix occasional warning at startup



commit 0f8e89268950013d04b456587d43913f14e14046
Author: Christian Hergert <chergert redhat com>
Date:   Fri Sep 22 17:32:56 2017 -0700

    beautifier: fix occasional warning at startup
    
    This appears to be racey, and after statically linking things in, it was
    more likely to appear.

 .../beautifier/gb-beautifier-editor-addin.c        |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/plugins/beautifier/gb-beautifier-editor-addin.c 
b/src/plugins/beautifier/gb-beautifier-editor-addin.c
index 2b5c302..65b571b 100644
--- a/src/plugins/beautifier/gb-beautifier-editor-addin.c
+++ b/src/plugins/beautifier/gb-beautifier-editor-addin.c
@@ -123,12 +123,15 @@ static void
 set_default_keybinding (GbBeautifierEditorAddin *self,
                         const gchar             *action_name)
 {
+  static const gchar *accel = "<primary><Alt>b";
   DzlShortcutController *controller;
-  gchar *accel = "<primary><Alt>b";
 
   g_assert (GB_IS_BEAUTIFIER_EDITOR_ADDIN (self));
   g_assert (action_name != NULL);
 
+  if (self->current_view == NULL)
+    return;
+
   controller = dzl_shortcut_controller_find (GTK_WIDGET (self->current_view));
   dzl_shortcut_controller_add_command_action (controller,
                                               "org.gnome.builder.editor-view.beautifier-default",


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