[FIXED] FairWriteoutBuffer::FillNewData and object ownership (memory leak) [message #14374] |
Fri, 18 January 2013 23:03 |
Oliver Merle
Messages: 13 Registered: December 2010
|
occasional visitor |
From: *vpn.uni-giessen.de
|
|
I am a bit confused about the question whether object ownership of the FairTimeStamp instance passed to FairWriteoutBuffer::FillNewData is transferred to the buffer or not.
I had a look at the implementation of the buffers in the SDS package and found that the digis therein are allocated on the heap but never freed. Therefore I assumed that the ownership has been transferred to the buffer and searched for the corresponding deallocation in the implementation of FairWriteoutBuffer+derived. Actually there is none. Finally, I've ran the TimeBasedSimulation macro in the macros/mvd folder and counted the FairTimeStamp instances at runtime - the number was increasing continuously, as expected.
But if the buffer is not freeing the digits, how can the user know if a digit can be safely deallocated? Wouldn't it make more sense to delete the digits after they have been written to the TClonesArray?
[Updated on: Thu, 31 January 2013 15:59] by Moderator Report message to a moderator
|
|
|