[libhandy/tab-fixes: 4/9] tab-box: Null-check drag icon in drag_end()




commit 079441d53486a0d88d0509f6d71a4e08dadeb190
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Sun Feb 7 13:57:26 2021 +0500

    tab-box: Null-check drag icon in drag_end()
    
    That function can be called multiple times in some cases.

 src/hdy-tab-box.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/hdy-tab-box.c b/src/hdy-tab-box.c
index cd076911..07064a99 100644
--- a/src/hdy-tab-box.c
+++ b/src/hdy-tab-box.c
@@ -3091,8 +3091,10 @@ hdy_tab_box_drag_end (GtkWidget      *widget,
 
   self->detached_page = NULL;
 
-  gtk_widget_destroy (self->drag_icon->window);
-  g_clear_pointer (&self->drag_icon, g_free);
+  if (self->drag_icon) {
+    gtk_widget_destroy (self->drag_icon->window);
+    g_clear_pointer (&self->drag_icon, g_free);
+  }
 }
 
 static gboolean


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