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: *
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.


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

Current Time: Tue Jul 23 08:05:25 CEST 2024

Total time taken to generate the page: 0.00741 seconds