# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1614519745 0 # Node ID 47f8f950f3779a550dda3bb12a1f16a698018332 # Parent 5363f953b22a3124b71611abd68342c87cfe6e47 GTK4: Fix crash by stopping processing after removing widget from the box. diff -r 5363f953b22a -r 47f8f950f377 gtk4/dw.c --- a/gtk4/dw.c Sun Feb 28 11:30:45 2021 +0000 +++ b/gtk4/dw.c Sun Feb 28 13:42:25 2021 +0000 @@ -1853,6 +1853,7 @@ if(gtk_grid_get_child_at(GTK_GRID(box), 0, z) == handle2) { gtk_grid_remove_row(GTK_GRID(box), z); + handle2 = NULL; break; } } @@ -1864,6 +1865,7 @@ if(gtk_grid_get_child_at(GTK_GRID(box), z, 0) == handle2) { gtk_grid_remove_column(GTK_GRID(box), z); + handle2 = NULL; break; } } @@ -1879,7 +1881,7 @@ /* Finally destroy the widget, make sure it is still * a valid widget if it got removed from the grid. */ - if(GTK_IS_WIDGET(handle2)) + if(handle2 && GTK_IS_WIDGET(handle2)) g_object_unref(G_OBJECT(handle2)); } }