[gtk/wip/exalm/headerbar: 2/2] headerbar: Null-check boxes when removing window controls




commit cf61d9618867dfd1ca69589593e679e0af54c761
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Mon Feb 8 18:46:35 2021 +0500

    headerbar: Null-check boxes when removing window controls
    
    Prevent a crash when show-title-buttons value changes to FALSE during
    destruction.

 gtk/gtkheaderbar.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkheaderbar.c b/gtk/gtkheaderbar.c
index 6f90f38f6b..786dfb754e 100644
--- a/gtk/gtkheaderbar.c
+++ b/gtk/gtkheaderbar.c
@@ -743,13 +743,13 @@ gtk_header_bar_set_show_title_buttons (GtkHeaderBar *bar,
     create_window_controls (bar);
   else
     {
-      if (bar->start_window_controls)
+      if (bar->start_box && bar->start_window_controls)
         {
           gtk_box_remove (GTK_BOX (bar->start_box), bar->start_window_controls);
           bar->start_window_controls = NULL;
         }
 
-      if (ar->end_window_controls)
+      if (bar->end_box && bar->end_window_controls)
         {
           gtk_box_remove (GTK_BOX (bar->end_box), bar->end_window_controls);
           bar->end_window_controls = NULL;


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