Mercurial > hg > orthanc
comparison OrthancServer/DicomProtocol/DicomServer.cpp @ 1193:e95e7f9eba96
fix crash when stopping Orthanc during a DICOM connection
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 20 Oct 2014 16:46:40 +0200 |
parents | 816dccaeb7cf |
children | a65ad39596cb |
comparison
equal
deleted
inserted
replaced
1192:2036c3865990 | 1193:e95e7f9eba96 |
---|---|
188 } | 188 } |
189 } | 189 } |
190 | 190 |
191 LOG(INFO) << "DICOM server stopping"; | 191 LOG(INFO) << "DICOM server stopping"; |
192 | 192 |
193 if (server->isThreaded_) | |
194 { | |
195 server->bagOfDispatchers_.StopAll(); | |
196 } | |
197 | |
193 /* drop the network, i.e. free memory of T_ASC_Network* structure. This call */ | 198 /* drop the network, i.e. free memory of T_ASC_Network* structure. This call */ |
194 /* is the counterpart of ASC_initializeNetwork(...) which was called above. */ | 199 /* is the counterpart of ASC_initializeNetwork(...) which was called above. */ |
195 cond = ASC_dropNetwork(&net); | 200 cond = ASC_dropNetwork(&net); |
196 if (cond.bad()) | 201 if (cond.bad()) |
197 { | 202 { |
401 | 406 |
402 if (pimpl_->thread_.joinable()) | 407 if (pimpl_->thread_.joinable()) |
403 { | 408 { |
404 pimpl_->thread_.join(); | 409 pimpl_->thread_.join(); |
405 } | 410 } |
406 | |
407 bagOfDispatchers_.StopAll(); | |
408 } | 411 } |
409 | 412 |
410 bool DicomServer::IsMyAETitle(const std::string& aet) const | 413 bool DicomServer::IsMyAETitle(const std::string& aet) const |
411 { | 414 { |
412 if (!HasCalledApplicationEntityTitleCheck()) | 415 if (!HasCalledApplicationEntityTitleCheck()) |