diff OrthancServer/ServerContext.cpp @ 2507:99116ed6f38c

invalidate DicomCache when deleting instance
author amazy
date Mon, 26 Mar 2018 18:31:40 +0200
parents 878b59270859
children 2e879c796ec7
line wrap: on
line diff
--- a/OrthancServer/ServerContext.cpp	Mon Mar 26 17:09:42 2018 +0200
+++ b/OrthancServer/ServerContext.cpp	Mon Mar 26 18:31:40 2018 +0200
@@ -562,6 +562,13 @@
                                      const std::string& uuid,
                                      ResourceType expectedType)
   {
+    if (expectedType == ResourceType_Instance)
+    {
+      // remove the file from the DicomCache
+      boost::mutex::scoped_lock lock(dicomCacheMutex_);
+      dicomCache_.Invalidate(uuid);
+    }
+
     return index_.DeleteResource(target, uuid, expectedType);
   }