# HG changeset patch # User s.jodogne@gmail.com # Date 1589544914 -7200 # Node ID cecedf0b1be6d04bec5ef3f3e37c620a1bbc8556 # Parent 1e132fe7090ebdf269dc629e9a023b12352ac47f fix for msvc2008 diff -r 1e132fe7090e -r cecedf0b1be6 Samples/Common/RtViewerApp.cpp --- a/Samples/Common/RtViewerApp.cpp Fri May 15 13:04:34 2020 +0200 +++ b/Samples/Common/RtViewerApp.cpp Fri May 15 14:15:14 2020 +0200 @@ -227,10 +227,17 @@ arguments_[key] = value; } - const std::string& RtViewerApp::GetArgument(const std::string& key) const + std::string RtViewerApp::GetArgument(const std::string& key) const { - ORTHANC_ASSERT(HasArgument(key)); - return arguments_.at(key); + std::map::const_iterator found = arguments_.find(key); + if (found == arguments_.end()) + { + throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls); + } + else + { + return found->second; + } } bool RtViewerApp::HasArgument(const std::string& key) const diff -r 1e132fe7090e -r cecedf0b1be6 Samples/Common/RtViewerApp.h --- a/Samples/Common/RtViewerApp.h Fri May 15 13:04:34 2020 +0200 +++ b/Samples/Common/RtViewerApp.h Fri May 15 14:15:14 2020 +0200 @@ -109,7 +109,7 @@ // SetArgument is above (public section) std::map arguments_; - const std::string& GetArgument(const std::string& key) const; + std::string GetArgument(const std::string& key) const; bool HasArgument(const std::string& key) const; /** diff -r 1e132fe7090e -r cecedf0b1be6 Samples/Sdl/RtViewer/RtViewerSdl.cpp --- a/Samples/Sdl/RtViewer/RtViewerSdl.cpp Fri May 15 13:04:34 2020 +0200 +++ b/Samples/Sdl/RtViewer/RtViewerSdl.cpp Fri May 15 14:15:14 2020 +0200 @@ -222,7 +222,7 @@ if (windowID == curWindowID) return view; } - return NULL; + return boost::shared_ptr(); } void RtViewerApp::SdlRunLoop(const std::vector >& views,