diff --git a/RELEASE.txt b/RELEASE.txt index 1cc4d4dff..12177f7c2 100755 --- a/RELEASE.txt +++ b/RELEASE.txt @@ -85,6 +85,8 @@ This document describes the differences between v7.0.0 and v6.x.x - number of storage cells is not updated in teh receiver. done. and also allowing it to be modified in running status - refactored memory structure in receiver and listener code (maybe resolves stuck issue, need to check) - callback modified to have rx header and not rx header pointer +-help should not create a new object + 2. Resolved Issues ================== diff --git a/slsDetectorSoftware/src/CmdLineApp.cpp b/slsDetectorSoftware/src/CmdLineApp.cpp index db3d03466..186c29c9b 100644 --- a/slsDetectorSoftware/src/CmdLineApp.cpp +++ b/slsDetectorSoftware/src/CmdLineApp.cpp @@ -53,16 +53,18 @@ int main(int argc, char *argv[]) { if (parser.isHelp()) action = slsDetectorDefs::HELP_ACTION; + else { - // Free shared memory should work also without a detector - // if we have an option for verify in the detector constructor - // we could avoid this but clutter the code - if (parser.command() == "free" && action != slsDetectorDefs::HELP_ACTION) { - if (parser.detector_id() != -1) - std::cout << "Cannot free shared memory of sub-detector\n"; - else - sls::freeSharedMemory(parser.multi_id()); - return 0; + // Free shared memory should work also without a detector + // if we have an option for verify in the detector constructor + // we could avoid this but clutter the code + if (parser.command() == "free") { + if (parser.detector_id() != -1) + std::cout << "Cannot free shared memory of sub-detector\n"; + else + sls::freeSharedMemory(parser.multi_id()); + return 0; + } } // prevent mem size check @@ -71,8 +73,11 @@ int main(int argc, char *argv[]) { } try { - sls::Detector det(parser.multi_id()); - sls::CmdProxy proxy(&det); + std::unique_ptr det{nullptr}; + if (action != slsDetectorDefs::HELP_ACTION) { + det = sls::make_unique(parser.multi_id()); + } + sls::CmdProxy proxy(det.get()); proxy.Call(parser.command(), parser.arguments(), parser.detector_id(), action, std::cout, parser.receiver_id()); } catch (const sls::RuntimeError &e) {