diff options
| author | Lars Magne Ingebrigtsen | 2013-08-19 17:14:42 +0200 |
|---|---|---|
| committer | Lars Magne Ingebrigtsen | 2013-08-19 17:14:42 +0200 |
| commit | 2a42bbcee8224aedd09afb48dbbe740e7124ae80 (patch) | |
| tree | e851b1d571d4daa48aa4a5e5cd7384b6706f9b11 /src | |
| parent | 6da26928029c4598e75a344d57c08ca85dd95f2a (diff) | |
| download | emacs-2a42bbcee8224aedd09afb48dbbe740e7124ae80.tar.gz emacs-2a42bbcee8224aedd09afb48dbbe740e7124ae80.zip | |
Fix previous commit.
(imagemagick_get_animation_cache): Revert to previous definition
so that it actually works. But keep the memory leak fix.
Diffstat (limited to 'src')
| -rw-r--r-- | src/image.c | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/src/image.c b/src/image.c index ec89ee076d9..00f2a035c44 100644 --- a/src/image.c +++ b/src/image.c | |||
| @@ -7895,6 +7895,7 @@ imagemagick_create_cache (char *signature) | |||
| 7895 | cache->wand = 0; | 7895 | cache->wand = 0; |
| 7896 | cache->index = 0; | 7896 | cache->index = 0; |
| 7897 | cache->next = 0; | 7897 | cache->next = 0; |
| 7898 | cache->update_time = current_emacs_time (); | ||
| 7898 | return cache; | 7899 | return cache; |
| 7899 | } | 7900 | } |
| 7900 | 7901 | ||
| @@ -7927,28 +7928,25 @@ imagemagick_get_animation_cache (MagickWand *wand) | |||
| 7927 | { | 7928 | { |
| 7928 | char *signature = MagickGetImageSignature (wand); | 7929 | char *signature = MagickGetImageSignature (wand); |
| 7929 | struct animation_cache *cache; | 7930 | struct animation_cache *cache; |
| 7930 | struct animation_cache **pcache; | ||
| 7931 | 7931 | ||
| 7932 | imagemagick_prune_animation_cache (); | 7932 | imagemagick_prune_animation_cache (); |
| 7933 | cache = animation_cache; | ||
| 7933 | 7934 | ||
| 7934 | if (! animation_cache) | 7935 | if (! cache) |
| 7935 | animation_cache = cache = imagemagick_create_cache (signature); | ||
| 7936 | else | ||
| 7937 | { | 7936 | { |
| 7938 | for (pcache = &animation_cache; *pcache; pcache = &cache->next) | 7937 | animation_cache = imagemagick_create_cache (signature); |
| 7939 | { | 7938 | return animation_cache; |
| 7940 | cache = *pcache; | 7939 | } |
| 7941 | if (! cache) | 7940 | |
| 7942 | { | 7941 | while (strcmp(signature, cache->signature) && |
| 7943 | animation_cache = cache = imagemagick_create_cache (signature); | 7942 | cache->next) |
| 7944 | break; | 7943 | cache = cache->next; |
| 7945 | } | 7944 | |
| 7946 | if (strcmp (signature, cache->signature) == 0) | 7945 | if (strcmp(signature, cache->signature)) |
| 7947 | { | 7946 | { |
| 7948 | DestroyString (signature); | 7947 | cache->next = imagemagick_create_cache (signature); |
| 7949 | break; | 7948 | DestroyString (signature); |
| 7950 | } | 7949 | return cache->next; |
| 7951 | } | ||
| 7952 | } | 7950 | } |
| 7953 | 7951 | ||
| 7954 | cache->update_time = current_emacs_time (); | 7952 | cache->update_time = current_emacs_time (); |