Subject: bug#75636: GTK memory leaks

From: Stefan Kangas <[email-masked]>
Date: Tue, 21 Jan 2025 10:33:51 -0800

Pip Cet via "Bug reports for GNU Emacs, the Swiss army knife of text
editors" <[email-masked]> writes:

> I think this second patch might also avoid future compiler warnings:
>
> diff --git a/src/gtkutil.c b/src/gtkutil.c
> index 97582a524da..73e9f778c75 100644
> --- a/src/gtkutil.c
> +++ b/src/gtkutil.c
> @@ -6123,8 +6123,7 @@ free_frame_tool_bar (struct frame *f)
>        else
>          gtk_widget_destroy (x->toolbar_widget);
>
> -      x->toolbar_widget = 0;
> -      x->toolbar_widget = 0;
> +      x->toolbar_widget = NULL;
>        x->toolbar_is_packed = false;
>        FRAME_TOOLBAR_TOP_HEIGHT (f) = FRAME_TOOLBAR_BOTTOM_HEIGHT (f) = 0;
>        FRAME_TOOLBAR_LEFT_WIDTH (f) = FRAME_TOOLBAR_RIGHT_WIDTH (f) = 0;

LGTM.