From: Po Lu Date: Sat, 29 Oct 2022 10:21:09 +0000 (+0800) Subject: Fix crash destroying NS frame tool bar X-Git-Tag: emacs-29.0.90~1616^2~397 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=6f3d8ec4f5f4107e2a14a0bd154b61e05a4586c7;p=emacs.git Fix crash destroying NS frame tool bar * src/nsterm.m (ns_draw_glyphless_glyph_string_foreground): Work around silly GCC bug causing splurious warnings. ([EmacsWindow dealloc]): Detach tool bar before dealloc'ing window. (bug#58857) --- diff --git a/src/nsterm.m b/src/nsterm.m index 1fc72d83f66..e70463b9877 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -4237,7 +4237,12 @@ ns_draw_glyphless_glyph_string_foreground (struct glyph_string *s) for (i = 0; i < s->nchars; i++, glyph++) { - char buf[7]; +#ifdef GCC_LINT + enum { PACIFY_GCC_BUG_81401 = 1 }; +#else + enum { PACIFY_GCC_BUG_81401 = 0 }; +#endif + char buf[7 + PACIFY_GCC_BUG_81401]; char *str = NULL; int len = glyph->u.glyphless.len; @@ -9158,6 +9163,7 @@ ns_create_font_panel_buttons (id target, SEL select, SEL cancel_action) NSTRACE ("[EmacsWindow dealloc]"); /* We need to release the toolbar ourselves. */ + [self setToolbar: nil]; [[self toolbar] release]; /* Also the last button press event . */