[gedit] window: fix assertion when quitting the window



commit 0f76850ddc44ebdf4c5fc82b744f2f787997dc45
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Thu May 21 16:02:05 2015 +0200

    window: fix assertion when quitting the window

 gedit/gedit-window.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/gedit/gedit-window.c b/gedit/gedit-window.c
index 17a4aba..73ed6c0 100644
--- a/gedit/gedit-window.c
+++ b/gedit/gedit-window.c
@@ -520,7 +520,15 @@ received_clipboard_contents (GtkClipboard     *clipboard,
        }
 
        action = g_action_map_lookup_action (G_ACTION_MAP (window), "paste");
-       g_simple_action_set_enabled (G_SIMPLE_ACTION (action), enabled);
+
+       /* Since this is emitted async, the disposal of the actions may have
+        * already happened. Ensure that we have an action before setting the
+        * state.
+        */
+       if (action != NULL)
+       {
+               g_simple_action_set_enabled (G_SIMPLE_ACTION (action), enabled);
+       }
 
        g_object_unref (window);
 }


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