From: Pip Cet Date: Wed, 22 Jan 2025 00:51:33 +0000 (+0000) Subject: Destroy GTK tool bar widget if it was never attached (bug#75636) X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d3733a3b20ec4d3e4894b0263e2291ac57253028;p=emacs.git Destroy GTK tool bar widget if it was never attached (bug#75636) * src/gtkutil.c (xg_free_frame_widgets): Call gtk_widget_destroy on an unpacked toolbar widget. (cherry picked from commit 6ea1e03fe7f9e49387789c86b8f91f6333de679c) --- diff --git a/src/gtkutil.c b/src/gtkutil.c index 171ffee1bd0..a1a2c6cbd20 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -1884,6 +1884,12 @@ xg_free_frame_widgets (struct frame *f) if (tbinfo) xfree (tbinfo); + if (x->toolbar_widget && !x->toolbar_is_packed) + { + gtk_widget_destroy (x->toolbar_widget); + x->toolbar_widget = NULL; + } + /* x_free_frame_resources should have taken care of it */ #ifndef HAVE_PGTK #ifdef HAVE_XDBE