]> git.eshelyaron.com Git - emacs.git/commitdiff
* src/image.c (gui_put_x_image): Avoid memory leak.
authorPo Lu <luangruo@yahoo.com>
Wed, 24 Jul 2024 12:06:15 +0000 (20:06 +0800)
committerEshel Yaron <me@eshelyaron.com>
Wed, 24 Jul 2024 16:58:03 +0000 (18:58 +0200)
(cherry picked from commit 23549d7175108ca632375f9cc4390ff3e53e4d1e)

src/image.c

index 9d97337fd31e5ca370d8d0bd200b0b3699bc94b6..1b26af0535144e69e05ef0b9e71a61ae2306d781 100644 (file)
@@ -4177,7 +4177,7 @@ static void
 gui_put_x_image (struct frame *f, Emacs_Pix_Container pimg,
                  Emacs_Pixmap pixmap, int width, int height)
 {
-#if defined USE_CAIRO || defined HAVE_HAIKU
+#if defined USE_CAIRO || defined HAVE_HAIKU || defined HAVE_NS
   eassert (pimg == pixmap);
 #elif defined HAVE_X_WINDOWS
   GC gc;
@@ -4189,12 +4189,7 @@ gui_put_x_image (struct frame *f, Emacs_Pix_Container pimg,
   XFreeGC (FRAME_X_DISPLAY (f), gc);
 #elif defined HAVE_ANDROID
   android_put_image (pixmap, pimg);
-#endif
-
-#ifdef HAVE_NS
-  eassert (pimg == pixmap);
-  ns_retain_object (pimg);
-#endif
+#endif /* HAVE_ANDROID */
 }
 
 /* Thin wrapper for image_create_x_image_and_pixmap_1, so that it matches