From: Po Lu Date: Wed, 24 Jul 2024 03:38:54 +0000 (+0800) Subject: Fix bug#72255 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f97fd1684b424860aa4da787999ea75aaca68047;p=emacs.git Fix bug#72255 * src/image.c (struct image_type): Minor grammatical corrections. (image_destroy_x_image): [HAVE_NS]: Do not release Emacs_Pix_Containers, which are identical to Emacs_Pixmaps and consequently always released with the `struct image'. (bug#72255) (cherry picked from commit 1ee8579eb7d7aae9405f33099559ac8205a59be2) --- diff --git a/src/image.c b/src/image.c index 90e6312e128..94404c09895 100644 --- a/src/image.c +++ b/src/image.c @@ -1328,11 +1328,11 @@ struct image_type image type. Value is true if SPEC is valid. */ bool (*valid_p) (Lisp_Object spec); - /* Load IMG which is used on frame F from information contained in - IMG->spec. Value is true if successful. */ + /* Load IMG which is to be used on frame F from information contained + in IMG->spec. Value is true if successful. */ bool (*load_img) (struct frame *f, struct image *img); - /* Free resources of image IMG which is used on frame F. */ + /* Free such resources of image IMG as are used on frame F. */ void (*free_img) (struct frame *f, struct image *img); #ifdef WINDOWSNT @@ -4154,16 +4154,16 @@ image_destroy_x_image (Emacs_Pix_Container pimg) eassert (input_blocked_p ()); if (pimg) { -#ifdef USE_CAIRO -#endif /* USE_CAIRO */ +#if defined USE_CAIRO || defined HAVE_HAIKU || defined HAVE_NS + /* On these systems, Emacs_Pix_Containers always point to the same + data as pixmaps in `struct image', and therefore must never be + freed separately. */ +#endif /* USE_CAIRO || HAVE_HAIKU || HAVE_NS */ #ifdef HAVE_NTGUI /* Data will be freed by DestroyObject. */ pimg->data = NULL; xfree (pimg); #endif /* HAVE_NTGUI */ -#ifdef HAVE_NS - ns_release_object (pimg); -#endif /* HAVE_NS */ } #endif }