comparison 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
comparison
equal deleted inserted replaced
2724:c8d369400ae1 2725:7caf01aa4d7b
78 { 78 {
79 } 79 }
80 80
81 void MemoryCache::Invalidate(const std::string& id) 81 void MemoryCache::Invalidate(const std::string& id)
82 { 82 {
83 if (index_.Contains(id)) 83 Page* p = NULL;
84 if (index_.Contains(id, p))
84 { 85 {
85 VLOG(1) << "Invalidating a cache page"; 86 VLOG(1) << "Invalidating a cache page";
87 assert(p != NULL);
88 delete p;
86 index_.Invalidate(id); 89 index_.Invalidate(id);
87 } 90 }
88 } 91 }
89 92
90 MemoryCache::~MemoryCache() 93 MemoryCache::~MemoryCache()