GSI Forum
GSI Helmholtzzentrum für Schwerionenforschung

Home » PANDA » PandaRoot » Bugs, Fixes, Releases » Question about using pointers to fill TClonesArray
Re: Question about using pointers to fill TClonesArray [message #17681 is a reply to message #17679] Thu, 18 December 2014 21:26 Go to previous messageGo to previous message
Klaus Götzen is currently offline  Klaus Götzen
Messages: 293
Registered: June 2006
Location: GSI
first-grade participant
From: *
Hi Tobias,

thanks for pointing out the issue a bit more detailed!

Just like to give one additonal remark: If the objects stored in the TClonesArray don't allocate memory dynamically (like TString, std::vector, ...), you don't even need to call TCA->Delete(), which calls the destructor for all objects, but only TCA->Clear() which doesn't do that and thus is much faster.

However, PndTrackCand owns a std::vector, therefore Delete() has to be called I think.

Btw this is the reason, why the daughters (the only 'dynamic' quantity) of RhoCandidate are stored in an array with fixed size. Although being somehow unelegant, the destructor of RhoCandidate has never to be called by RhoFactory making it really fast. There actually was a severe memory leak before I got aware of that issue ...

Best and merry x-mas,
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: [FIXED] fts/FtsTracking/PndFtsHoughSpace.h::ExportTH2S() declared but not implemented
Next Topic: [FIXED] Memory leak in PndSttHitProducerRealFull / PndFtsHitProducerRealFull?
Goto Forum:

Current Time: Fri Jul 12 21:38:18 CEST 2024

Total time taken to generate the page: 0.00726 seconds