I have very bizzare problem with memory leak when I’m using my own classes (compiled with ACLiC) as a part of larger program. Unfortunatelly it is not easy to create minimal code which reproduce it - things can start/stop works even by rename objects…
Here is an error itself:
First of all to exclude that problem lies on definition of class side, please look at the header file:
using namespace std;
class sym: public TNamed
sym(const char* name);
Memory leak appear when I’m closing the root file (TFile::Close()).
TFile::Close() calls TDirectoryFile::Close() which calls
fList->Delete() (fList is a objectof THashList) which calls
TList::Delete() which calls
TCollection::GarbageCollectTCollection(tlk->GetObject()) (tlk is TObjLink object) where object is finally deleted:
And problem occur when I’m using myown class with other root objects, e.g. histogram and during deletion of this histogram in GarbageCollection. It looks as if deletion is performed on nonexisting object. I suppose that histogram is somehow deleted during deletion of myown class (which was deleted previously). However I have access to this histogram just before delete (can check its name and so on). When I declare histogram before my own class in main program it is deleted first and problem doesn’t exists (it is probably still there by I delete “not crucial” part of memory).
Any suggestion how to dubug it further?