From 14770dccd4777d313e49d0052e15530385574f82 Mon Sep 17 00:00:00 2001 From: Reuben Green Date: Thu, 25 Jul 2019 08:47:46 +0100 Subject: [PATCH] Prevent premature disposal of clipboard manager (Bug 15635) --- thunar/thunar-window.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/thunar/thunar-window.c b/thunar/thunar-window.c index f626baf1..7755725b 100644 --- a/thunar/thunar-window.c +++ b/thunar/thunar-window.c @@ -1428,10 +1428,13 @@ thunar_window_unrealize (GtkWidget *widget) /* disconnect from the clipboard manager */ g_signal_handlers_disconnect_by_func (G_OBJECT (window->clipboard), gtk_widget_queue_draw, widget); - g_object_unref (G_OBJECT (window->clipboard)); /* let the GtkWidget class unrealize the window */ (*GTK_WIDGET_CLASS (thunar_window_parent_class)->unrealize) (widget); + + /* drop the reference on the clipboard manager, we do this after letting the GtkWidget class + * unrealise the window to prevent the clipboard being disposed during the unrealize */ + g_object_unref (G_OBJECT (window->clipboard)); } -- 2.20.1