Re: [ROOT] TList::Delete and object ownership

From: Rene Brun (Rene.Brun@cern.ch)
Date: Mon Jan 26 2004 - 14:37:29 MET


Matt,

Use TH1::AddDirectory(kFALSE);  (static function)

In this case, the histograms will not be registered to the current directory
by default. You will have to write the histograms one by one..

Rene Brun

Matt Palmer wrote:
> 
> Hi,
> 
> We have an application that wants to save histograms to a file.  Pretty
> simple, except those histograms are owned by some of our objects (which
> aren't saved).  When the file is closed, the histograms are deleted
> which is obviously not what we want.  I thought it would be possible to
> use one of the 2 seemingly independant ownership options:
> TList::SetOwner or TObject::kCanDelete to prevent ROOT deleting our
> objects.  However, it seems that TList::Delete ignores both of these
> options.  Is there any other way of stopping ROOT deleting our objects?
> 
> Thanks,
> Matt



This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:05 MET