From fd98e52e0efdb5e7bbf37919e3e95f8e440313b0 Mon Sep 17 00:00:00 2001 From: Helmut Eller Date: Sun, 5 May 2024 09:01:06 +0200 Subject: [PATCH] Make xg_frame_tb_info an ambiguous root We could use exact references in the future. * src/gtkutil.c (xg_create_tool_bar): Use igc_xzalloc_ambig for allocation. (free_frame_tool_bar): Use igc_xfree to free it. --- src/gtkutil.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/gtkutil.c b/src/gtkutil.c index 342dd35da13..31e0b915000 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -5496,7 +5496,12 @@ xg_create_tool_bar (struct frame *f) TB_INFO_KEY); if (! tbinfo) { +#ifdef HAVE_MPS + // FIXME: use exact references + tbinfo = igc_xzalloc_ambig (sizeof (*tbinfo)); +#else tbinfo = xmalloc (sizeof (*tbinfo)); +#endif tbinfo->last_tool_bar = Qnil; tbinfo->style = Qnil; tbinfo->hmargin = tbinfo->vmargin = 0; @@ -6162,7 +6167,11 @@ free_frame_tool_bar (struct frame *f) TB_INFO_KEY); if (tbinfo) { +#ifdef HAVE_MPS + igc_xfree (tbinfo); +#else xfree (tbinfo); +#endif g_object_set_data (G_OBJECT (FRAME_GTK_OUTER_WIDGET (f)), TB_INFO_KEY, NULL); -- 2.39.2