diff OrthancServer/Sources/ServerJobs/ResourceModificationJob.cpp @ 5175:48005e522bd6

start fixing thread safety issues with DicomMap
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 24 Mar 2023 19:00:33 +0100
parents 02cfd23a556a
children 0ea402b4d901
line wrap: on
line diff
--- a/OrthancServer/Sources/ServerJobs/ResourceModificationJob.cpp	Wed Mar 22 08:26:41 2023 +0100
+++ b/OrthancServer/Sources/ServerJobs/ResourceModificationJob.cpp	Fri Mar 24 19:00:33 2023 +0100
@@ -749,8 +749,11 @@
               DicomMap targetPatientTags;
               targetPatient.tags_.ExtractPatientInformation(targetPatientTags);
 
-              for (std::set<DicomTag>::const_iterator mainPatientTag = DicomMap::GetMainDicomTags(ResourceType_Patient).begin();
-                    mainPatientTag != DicomMap::GetMainDicomTags(ResourceType_Patient).end(); ++mainPatientTag)
+              std::set<DicomTag> mainPatientTags;
+              DicomMap::GetMainDicomTags(mainPatientTags, ResourceType_Patient);
+              
+              for (std::set<DicomTag>::const_iterator mainPatientTag = mainPatientTags.begin();
+                   mainPatientTag != mainPatientTags.end(); ++mainPatientTag)
               {
                 if (targetPatientTags.HasTag(*mainPatientTag) 
                     && (!modification_->IsReplaced(*mainPatientTag)