]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix crash destroying NS frame tool bar
authorPo Lu <luangruo@yahoo.com>
Sat, 29 Oct 2022 10:21:09 +0000 (18:21 +0800)
committerPo Lu <luangruo@yahoo.com>
Sat, 29 Oct 2022 10:22:28 +0000 (18:22 +0800)
* 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)

src/nsterm.m

index 1fc72d83f66fe157685ea68d7548f381e2c5ca3b..e70463b9877214f647d906412daaed92839bb17f 100644 (file)
@@ -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 .  */