]> git.eshelyaron.com Git - emacs.git/commitdiff
Patch bug#77128
authorPo Lu <luangruo@yahoo.com>
Sun, 23 Mar 2025 11:43:13 +0000 (19:43 +0800)
committerEshel Yaron <me@eshelyaron.com>
Sun, 23 Mar 2025 19:34:25 +0000 (20:34 +0100)
* src/pgtkterm.c (pgtk_flash): Destroy `cr_surface_visible_bell'
if still present.  (bug#77128)

(cherry picked from commit 7d14e35498209e45290f5c1297ded6d7175bf1ea)

src/pgtkterm.c

index 94b29b5ac9b8194b815860003ba5b88b3434510c..889f8fc127051520d172417335ada69fb4277ffa 100644 (file)
@@ -3833,6 +3833,11 @@ pgtk_flash (struct frame *f)
       cairo_fill (cr);
     }
 
+  /* This surface may be leaked if XTflash is invoked again after a
+     visible bell but before the atimer has had an opportunity to undo
+     the first invocation.  (bug#77128) */
+  if (FRAME_X_OUTPUT (f)->cr_surface_visible_bell)
+    cairo_surface_destroy (FRAME_X_OUTPUT (f)->cr_surface_visible_bell);
   FRAME_X_OUTPUT (f)->cr_surface_visible_bell = surface;
 
   delay = make_timespec (0, 50 * 1000 * 1000);