diff options
| author | Po Lu | 2024-07-24 20:06:15 +0800 |
|---|---|---|
| committer | Po Lu | 2024-07-24 20:13:01 +0800 |
| commit | 23549d7175108ca632375f9cc4390ff3e53e4d1e (patch) | |
| tree | 20fd16e21b3339db5d784c036b33991698d554db /src | |
| parent | cb633820c151c9cf428a88f43b0a62f185c4f587 (diff) | |
| download | emacs-23549d7175108ca632375f9cc4390ff3e53e4d1e.tar.gz emacs-23549d7175108ca632375f9cc4390ff3e53e4d1e.zip | |
* src/image.c (gui_put_x_image): Avoid memory leak.
Diffstat (limited to 'src')
| -rw-r--r-- | src/image.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/image.c b/src/image.c index 96280f3ef46..db1b05cbcd7 100644 --- a/src/image.c +++ b/src/image.c | |||
| @@ -4176,7 +4176,7 @@ static void | |||
| 4176 | gui_put_x_image (struct frame *f, Emacs_Pix_Container pimg, | 4176 | gui_put_x_image (struct frame *f, Emacs_Pix_Container pimg, |
| 4177 | Emacs_Pixmap pixmap, int width, int height) | 4177 | Emacs_Pixmap pixmap, int width, int height) |
| 4178 | { | 4178 | { |
| 4179 | #if defined USE_CAIRO || defined HAVE_HAIKU | 4179 | #if defined USE_CAIRO || defined HAVE_HAIKU || defined HAVE_NS |
| 4180 | eassert (pimg == pixmap); | 4180 | eassert (pimg == pixmap); |
| 4181 | #elif defined HAVE_X_WINDOWS | 4181 | #elif defined HAVE_X_WINDOWS |
| 4182 | GC gc; | 4182 | GC gc; |
| @@ -4188,12 +4188,7 @@ gui_put_x_image (struct frame *f, Emacs_Pix_Container pimg, | |||
| 4188 | XFreeGC (FRAME_X_DISPLAY (f), gc); | 4188 | XFreeGC (FRAME_X_DISPLAY (f), gc); |
| 4189 | #elif defined HAVE_ANDROID | 4189 | #elif defined HAVE_ANDROID |
| 4190 | android_put_image (pixmap, pimg); | 4190 | android_put_image (pixmap, pimg); |
| 4191 | #endif | 4191 | #endif /* HAVE_ANDROID */ |
| 4192 | |||
| 4193 | #ifdef HAVE_NS | ||
| 4194 | eassert (pimg == pixmap); | ||
| 4195 | ns_retain_object (pimg); | ||
| 4196 | #endif | ||
| 4197 | } | 4192 | } |
| 4198 | 4193 | ||
| 4199 | /* Thin wrapper for image_create_x_image_and_pixmap_1, so that it matches | 4194 | /* Thin wrapper for image_create_x_image_and_pixmap_1, so that it matches |