diff --git a/macro/run/run_unpack_online.C b/macro/run/run_unpack_online.C index 67ee8802220eaa7af9aa0b3aef89030dfc48b94e..2acf1e6666ad9eaaf02a02fbdc44bfcc9669f723 100644 --- a/macro/run/run_unpack_online.C +++ b/macro/run/run_unpack_online.C @@ -451,7 +451,7 @@ void run_unpack_online(std::vector<std::string> publisher = {"tcp://localhost:55 // ------------------------------------------------------------------------ // ----- CbmSourceTsArchive ------------------------------------------- - auto source = new CbmSourceTsArchive(publisher); + std::unique_ptr<CbmSourceTsArchive> source = std::unique_ptr<CbmSourceTsArchive>(new CbmSourceTsArchive(publisher)); auto unpack = source->GetRecoUnpack(); unpack->SetDoPerfProfiling(doPerfProfiling); unpack->SetOutputFilename(perfProfFileName); @@ -471,7 +471,7 @@ void run_unpack_online(std::vector<std::string> publisher = {"tcp://localhost:55 // ----- FairRunAna --------------------------------------------------- - auto run = new FairRunOnline(source); + auto run = new FairRunOnline(source.release()); auto sink = new FairRootFileSink(outfilename.data()); run->SetSink(sink); auto eventheader = new CbmTsEventHeader(); @@ -516,11 +516,10 @@ void run_unpack_online(std::vector<std::string> publisher = {"tcp://localhost:55 // ------------------------------------------------------------------------ // -- Release all shared pointers to config before ROOT destroys things - - // => We need to destroy things by hand because run->Finish calls (trhought the FairRootManager) Source->Close which + // => We need to destroy things by hand because run->Finish calls (through the FairRootManager) Source->Close which // does call the Source destructor, so due to share pointer things stay alive until out of macro scope... run->SetSource(nullptr); delete run; - delete source; bmonconfig.reset(); stsconfig.reset(); diff --git a/macro/run/run_unpack_online_bmon.C b/macro/run/run_unpack_online_bmon.C index 65aa2a8c2099efee4f3bb275d22994e13ea873e1..fdcee3ddeecdde2e78a02bf3ce1e37cb45e6379e 100644 --- a/macro/run/run_unpack_online_bmon.C +++ b/macro/run/run_unpack_online_bmon.C @@ -124,7 +124,7 @@ void run_unpack_online_bmon(std::vector<std::string> publisher = {"tcp://localho // ------------------------------------------------------------------------ // ----- CbmSourceTsArchive ------------------------------------------- - auto source = new CbmSourceTsArchive(publisher); + std::unique_ptr<CbmSourceTsArchive> source = std::unique_ptr<CbmSourceTsArchive>(new CbmSourceTsArchive(publisher)); auto unpack = source->GetRecoUnpack(); //unpack->SetDoPerfProfiling(doPerfProfiling); //unpack->SetOutputFilename(perfProfFileName); @@ -137,7 +137,7 @@ void run_unpack_online_bmon(std::vector<std::string> publisher = {"tcp://localho // ----- FairRunAna --------------------------------------------------- - auto run = new FairRunOnline(source); + auto run = new FairRunOnline(source.release()); auto sink = new FairRootFileSink(outfilename.data()); run->SetSink(sink); auto eventheader = new CbmTsEventHeader(); @@ -182,11 +182,10 @@ void run_unpack_online_bmon(std::vector<std::string> publisher = {"tcp://localho // ------------------------------------------------------------------------ // -- Release all shared pointers to config before ROOT destroys things - - // => We need to destroy things by hand because run->Finish calls (trhought the FairRootManager) Source->Close which + // => We need to destroy things by hand because run->Finish calls (through the FairRootManager) Source->Close which // does call the Source destructor, so due to share pointer things stay alive until out of macro scope... run->SetSource(nullptr); delete run; - delete source; bmonconfig.reset(); // ------------------------------------------------------------------------ diff --git a/macro/run/run_unpack_tsa.C b/macro/run/run_unpack_tsa.C index c8128016ed3fb0dc9aeea2220ed5ad6c8941f6f8..1b81888a8d24381090dad335162236c04b20c41d 100644 --- a/macro/run/run_unpack_tsa.C +++ b/macro/run/run_unpack_tsa.C @@ -464,7 +464,7 @@ void run_unpack_tsa(std::vector<std::string> infile = {"test.tsa"}, UInt_t runid // ------------------------------------------------------------------------ // ----- CbmSourceTsArchive ------------------------------------------- - auto source = new CbmSourceTsArchive(infile); + std::unique_ptr<CbmSourceTsArchive> source = std::unique_ptr<CbmSourceTsArchive>(new CbmSourceTsArchive(infile)); auto unpack = source->GetRecoUnpack(); unpack->SetDoPerfProfiling(doPerfProfiling); /// Uncomment following line to enable extra hists about unpacker and detectors performances (I/O, I/O shares, expan.) @@ -487,7 +487,7 @@ void run_unpack_tsa(std::vector<std::string> infile = {"test.tsa"}, UInt_t runid // ----- FairRunAna --------------------------------------------------- - auto run = new FairRunOnline(source); + auto run = new FairRunOnline(source.release()); auto sink = new FairRootFileSink(outfilename.data()); run->SetSink(sink); auto eventheader = new CbmTsEventHeader(); @@ -525,11 +525,10 @@ void run_unpack_tsa(std::vector<std::string> infile = {"test.tsa"}, UInt_t runid // ------------------------------------------------------------------------ // -- Release all shared pointers to config before ROOT destroys things - - // => We need to destroy things by hand because run->Finish calls (trhought the FairRootManager) Source->Close which + // => We need to destroy things by hand because run->Finish calls (through the FairRootManager) Source->Close which // does call the Source destructor, so due to share pointer things stay alive until out of macro scope... run->SetSource(nullptr); delete run; - delete source; bmonconfig.reset(); stsconfig.reset(); diff --git a/macro/run/run_unpack_tsa_bmon.C b/macro/run/run_unpack_tsa_bmon.C index 2479bdf3b66f5e72e80f9db7880ce728f164ec09..7da33d24e5b078842104a2cb45814e487c7349dc 100644 --- a/macro/run/run_unpack_tsa_bmon.C +++ b/macro/run/run_unpack_tsa_bmon.C @@ -137,7 +137,7 @@ void run_unpack_tsa_bmon(std::vector<std::string> infile = {"test.tsa"}, UInt_t // ------------------------------------------------------------------------ // ----- CbmSourceTsArchive ------------------------------------------- - auto source = new CbmSourceTsArchive(infile); + std::unique_ptr<CbmSourceTsArchive> source = std::unique_ptr<CbmSourceTsArchive>(new CbmSourceTsArchive(infile)); auto unpack = source->GetRecoUnpack(); unpack->SetDoPerfProfiling(doPerfProfiling); unpack->SetOutputFilename(perfProfFileName); @@ -148,7 +148,7 @@ void run_unpack_tsa_bmon(std::vector<std::string> infile = {"test.tsa"}, UInt_t // ------------------------------------------------------------------------ // ----- FairRunAna --------------------------------------------------- - auto run = new FairRunOnline(source); + auto run = new FairRunOnline(source.release()); auto sink = new FairRootFileSink(outfilename.data()); run->SetSink(sink); auto eventheader = new CbmTsEventHeader(); @@ -186,11 +186,10 @@ void run_unpack_tsa_bmon(std::vector<std::string> infile = {"test.tsa"}, UInt_t // ------------------------------------------------------------------------ // -- Release all shared pointers to config before ROOT destroys things - - // => We need to destroy things by hand because run->Finish calls (trhought the FairRootManager) Source->Close which + // => We need to destroy things by hand because run->Finish calls (through the FairRootManager) Source->Close which // does call the Source destructor, so due to share pointer things stay alive until out of macro scope... run->SetSource(nullptr); delete run; - delete source; bmonconfig.reset(); // ------------------------------------------------------------------------