* 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)
committerPo Lu <luangruo@yahoo.com>
Wed, 24 Jul 2024 12:13:01 +0000 (20:13 +0800)
src/image.c

index 96280f3ef466b6272f92a53f8a3dba066b319795..db1b05cbcd7c2c36a6d2b39d2d7363af5269ce9a 100644 (file)
@@ -4176,7 +4176,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;
@@ -4188,12 +4188,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