GSI Forum
GSI Helmholtzzentrum für Schwerionenforschung

Home » PANDA » PandaRoot » Bugs, Fixes, Releases » [FIXED] Memory leak with TClonesArray and std::vector
Re: Memory leak with TClonesArray and std::vector [message #15321 is a reply to message #15320] Fri, 23 August 2013 10:38 Go to previous messageGo to previous message
Florian Uhlig is currently offline  Florian Uhlig
Messages: 424
Registered: May 2007
first-grade participant
From: *gsi.de
Hi Klaus,

you have to do a tca->Delete(); instead of a tca->Clear();

Clear will only release the memory used by the TClonesArray. Since the used vector is stored outside of the memory region used by the TClonesArray you delete only a pointer and you have a memory leak.

Delete will call the destructor of the object and such clear also memory used by the vector.

Ciao

Florian
 
Read Message
Read Message
Read Message
Previous Topic: [FIXED] genfit was moved
Next Topic: [FIXED] Error from PndMCTrackAssociator
Goto Forum:
  


Current Time: Thu Mar 28 10:26:44 CET 2024

Total time taken to generate the page: 0.01129 seconds