diff Core/Cache/MemoryCache.cpp @ 2725:7caf01aa4d7b jobs

Fix memory leak introduced by changeset #99116ed6f38c in Orthanc 1.3.2
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 12 Jul 2018 16:07:56 +0200
parents 99116ed6f38c
children 4e43e67f8ecf
line wrap: on
line diff
--- a/Core/Cache/MemoryCache.cpp	Thu Jul 12 15:54:37 2018 +0200
+++ b/Core/Cache/MemoryCache.cpp	Thu Jul 12 16:07:56 2018 +0200
@@ -80,9 +80,12 @@
 
   void MemoryCache::Invalidate(const std::string& id)
   {
-    if (index_.Contains(id))
+    Page* p = NULL;
+    if (index_.Contains(id, p))
     {
       VLOG(1) << "Invalidating a cache page";
+      assert(p != NULL);
+      delete p;
       index_.Invalidate(id);
     }
   }