[evolution/gnome-3-24] Revert part of commit a2811a413cf3efde9030b71274f1bba0b90938ab



commit ef6fc9069f2d389d72b3c79cb20904de047b302e
Author: Milan Crha <mcrha redhat com>
Date:   Tue Jul 11 15:10:54 2017 +0200

    Revert part of commit a2811a413cf3efde9030b71274f1bba0b90938ab
    
    This part could cause crash on close of Evolution, due to use-after-free.

 src/e-util/e-focus-tracker.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/src/e-util/e-focus-tracker.c b/src/e-util/e-focus-tracker.c
index 613f95e..c4390e3 100644
--- a/src/e-util/e-focus-tracker.c
+++ b/src/e-util/e-focus-tracker.c
@@ -370,6 +370,8 @@ focus_tracker_targets_received_cb (GtkClipboard *clipboard,
                focus_tracker_editor_update_actions (
                        focus_tracker, E_CONTENT_EDITOR (focus),
                        targets, n_targets);
+
+       g_object_unref (focus_tracker);
 }
 
 static void
@@ -1082,8 +1084,6 @@ void
 e_focus_tracker_update_actions (EFocusTracker *focus_tracker)
 {
        GtkClipboard *clipboard;
-       GdkAtom *targets = NULL;
-       gint n_targets;
 
        g_return_if_fail (E_IS_FOCUS_TRACKER (focus_tracker));
 
@@ -1091,10 +1091,10 @@ e_focus_tracker_update_actions (EFocusTracker *focus_tracker)
 
        clipboard = gtk_clipboard_get (GDK_SELECTION_CLIPBOARD);
 
-       if (gtk_clipboard_wait_for_targets (clipboard, &targets, &n_targets)) {
-               focus_tracker_targets_received_cb (clipboard, targets, n_targets, focus_tracker);
-               g_free (targets);
-       }
+       gtk_clipboard_request_targets (
+               clipboard, (GtkClipboardTargetsReceivedFunc)
+               focus_tracker_targets_received_cb,
+               g_object_ref (focus_tracker));
 }
 
 void


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