]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Thu, 10 Sep 2009 23:43:34 +0000 (23:43 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Thu, 10 Sep 2009 23:43:34 +0000 (23:43 +0000)
magick/cache.c

index 0a0a0b36465e1f16cde5604318fddbd9ce59283e..274e506024f76be9ac386c69854f0efc807520e8 100644 (file)
@@ -1468,12 +1468,6 @@ MagickExport Cache DestroyPixelCache(Cache cache)
   CacheInfo
     *cache_info;
 
-  CacheType
-    type;
-
-  MapMode
-    mode;
-
   assert(cache != (Cache) NULL);
   cache_info=(CacheInfo *) cache;
   assert(cache_info->signature == MagickSignature);
@@ -1490,11 +1484,14 @@ MagickExport Cache DestroyPixelCache(Cache cache)
   (void) UnlockSemaphoreInfo(cache_info->semaphore);
   if (cache_resources != (SplayTreeInfo *) NULL)
     (void) DeleteNodeByValueFromSplayTree(cache_resources,cache_info);
-  type=cache_info->type;
-  mode=cache_info->mode;
-  RelinquishPixelCachePixels(cache_info);
-  if ((mode != ReadMode) && ((type == MapCache) || (type == DiskCache)))
-    (void) RelinquishUniqueFileResource(cache_info->cache_filename);
+  if ((cache_info->mode == ReadMode) || ((cache_info->type != MapCache) &&
+      (cache_info->type != DiskCache)))
+    RelinquishPixelCachePixels(cache_info);
+  else
+    {
+      RelinquishPixelCachePixels(cache_info);
+      (void) RelinquishUniqueFileResource(cache_info->cache_filename);
+    }
   *cache_info->cache_filename='\0';
   if (cache_info->nexus_info != (NexusInfo **) NULL)
     cache_info->nexus_info=DestroyPixelCacheNexus(cache_info->nexus_info,