diff options
| author | Po Lu | 2024-07-09 22:00:39 +0800 |
|---|---|---|
| committer | Po Lu | 2024-07-09 22:02:22 +0800 |
| commit | 8350ebd22e983df5eb9ad33d427bd3d6a09ffe7f (patch) | |
| tree | b646bd9d4befd3b30fb6e7ad146d8fddb8649925 /src/image.c | |
| parent | 8f96e0064fa701655413bdeb4612b5b2a63102c4 (diff) | |
| download | emacs-8350ebd22e983df5eb9ad33d427bd3d6a09ffe7f.tar.gz emacs-8350ebd22e983df5eb9ad33d427bd3d6a09ffe7f.zip | |
Fix bug#71929
* src/image.c (free_image_cache): Unconditionally release image
cache, as this function is only called with its existence
already established.
* src/xfaces.c (free_frame_faces): Clear FRAME_IMAGE_CACHE (f).
(bug#71929)
Diffstat (limited to 'src/image.c')
| -rw-r--r-- | src/image.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/src/image.c b/src/image.c index 2945447b962..2ee2f3245be 100644 --- a/src/image.c +++ b/src/image.c | |||
| @@ -2304,23 +2304,18 @@ void | |||
| 2304 | free_image_cache (struct frame *f) | 2304 | free_image_cache (struct frame *f) |
| 2305 | { | 2305 | { |
| 2306 | struct image_cache *c = FRAME_IMAGE_CACHE (f); | 2306 | struct image_cache *c = FRAME_IMAGE_CACHE (f); |
| 2307 | if (c) | 2307 | ptrdiff_t i; |
| 2308 | { | ||
| 2309 | ptrdiff_t i; | ||
| 2310 | 2308 | ||
| 2311 | /* Cache should not be referenced by any frame when freed. */ | 2309 | /* Cache should not be referenced by any frame when freed. */ |
| 2312 | eassert (c->refcount == 0); | 2310 | eassert (c->refcount == 0); |
| 2313 | 2311 | ||
| 2314 | for (i = 0; i < c->used; ++i) | 2312 | for (i = 0; i < c->used; ++i) |
| 2315 | free_image (f, c->images[i]); | 2313 | free_image (f, c->images[i]); |
| 2316 | xfree (c->images); | 2314 | xfree (c->images); |
| 2317 | xfree (c->buckets); | 2315 | xfree (c->buckets); |
| 2318 | xfree (c); | 2316 | xfree (c); |
| 2319 | FRAME_IMAGE_CACHE (f) = NULL; | ||
| 2320 | } | ||
| 2321 | } | 2317 | } |
| 2322 | 2318 | ||
| 2323 | |||
| 2324 | /* Clear image cache of frame F. FILTER=t means free all images. | 2319 | /* Clear image cache of frame F. FILTER=t means free all images. |
| 2325 | FILTER=nil means clear only images that haven't been | 2320 | FILTER=nil means clear only images that haven't been |
| 2326 | displayed for some time. | 2321 | displayed for some time. |