Mercurial > hg > orthanc
diff Plugins/Samples/GdcmDecoder/GdcmDecoderCache.cpp @ 3768:6110a4995ace
replacing std::auto_ptr by std::unique_ptr in GDCM sample plugin
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 17 Mar 2020 15:02:23 +0100 |
parents | 94f4a18a79cc |
children | 7e33516965f8 |
line wrap: on
line diff
--- a/Plugins/Samples/GdcmDecoder/GdcmDecoderCache.cpp Tue Mar 17 14:46:06 2020 +0100 +++ b/Plugins/Samples/GdcmDecoder/GdcmDecoderCache.cpp Tue Mar 17 15:02:23 2020 +0100 @@ -21,6 +21,7 @@ #include "GdcmDecoderCache.h" +#include "../../../Core/Compatibility.h" #include "OrthancImageWrapper.h" namespace OrthancPlugins @@ -83,13 +84,13 @@ } // This is not the same image - std::auto_ptr<GdcmImageDecoder> decoder(new GdcmImageDecoder(dicom, size)); - std::auto_ptr<OrthancImageWrapper> image(new OrthancImageWrapper(context, decoder->Decode(context, frameIndex))); + std::unique_ptr<GdcmImageDecoder> decoder(new GdcmImageDecoder(dicom, size)); + std::unique_ptr<OrthancImageWrapper> image(new OrthancImageWrapper(context, decoder->Decode(context, frameIndex))); { // Cache the newly created decoder for further use boost::mutex::scoped_lock lock(mutex_); - decoder_ = decoder; + decoder_.reset(decoder.release()); size_ = size; md5_ = md5; }