Re: [ROOT] Calling destructors

From: Anton Fokin (anton.fokin@smartquant.com)
Date: Sat Jan 27 2001 - 12:48:45 MET


Hi Fons,

thanks for the reply. I understand what you said but at the same time
ROOT/CINT holds a list of all objects in memory so that I thought ROOT
should take care about calling destructors before program termination. This
can be set as an option though. Is it possible/helpful?

Regards,
Anton

----- Original Message -----
From: Fons Rademakers <Fons.Rademakers@cern.ch>
To: Anton Fokin <anton.fokin@smartquant.com>
Cc: roottalk <roottalk@pcroot.cern.ch>
Sent: Saturday, January 27, 2001 11:17 AM
Subject: Re: [ROOT] Calling destructors


> Hi Anton,
>
>   this has nothing to do with ROOT but is a standard C++ feature.
> If you create an object on the heap (with new) you have to explicitely
> call delete somewhere down the line before the program exits.
> If you create the object on the stack the destructor will automatically be
> called as soon as the object goes out of scope (in case of .q). If that
> is not the case for you send me an example so we can investigate.
>
> Cheers, Fons.
>
>
>
>
> On Fri, Jan 26, 2001 at 11:54:33PM +0100, Anton Fokin wrote:
> > Hi,
> >
> > I noticed that ROOT doesn't call destructors for objects in memory when
you
> > quit it (by .q). Is it a kind of feature? I have for example Save()
function
> > in my TDataManager and since ROOT doesn't call data manager object
> > destructor the data are not saved too. Of course I can add things in
> > rootlogoff.C macro but ...
> >
> > By the way, can some function (which will call destructors, close open
> > files, sockets, etc.) be called on the system (root session) crash?
> >
> > Regards,
> > Anton
>
> --
> Org:    CERN, European Laboratory for Particle Physics.
> Mail:   1211 Geneve 23, Switzerland
> E-Mail: Fons.Rademakers@cern.ch              Phone: +41 22 7679248
> WWW:    http://root.cern.ch/~rdm/            Fax:   +41 22 7677910
>
>



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:34 MET