Re: Deleting TGlobal objects from memory

From: Rene Brun <brun_at_pcroot.cern.ch>
Date: Mon, 9 May 2005 09:03:43 +0200 (MEST)


gROOT->Reset resets all global symbols defined to CINT following the execution of rootlogon.C
Global symbols should be restricted to small unnamed macros.

Always use named macros following the normal C++ scoping rules and your problem will not exist anymore

Rene Brun

On Fri, 6
May 2005, Germano Percossi wrote:

> Germano Percossi wrote:
> > Hi all
> >
> > Is there any way to delete global objects from memory?
> > Specifically I need to delete some macro definitions loaded when loading
> > my macro.
> > I load the macro "macro.cxx" that contains an #include directive for a
> > file "macro.hh", that contains some #ifndef and #define commands;
> > unloading macro.cxx, macro definitions are still there (obviuosly) but
> > this forbid macro.hh to be loaded again.
> >
> > Till now I tried with (supposing my macro is MACRO_H)
> >
> > gROOT->GetListOfGlobals()->FindObject("MACRO_H")->Delete()
> >
> > and all its casted variants but when typing again
> >
> > gROOT->GetListOfGlobals()->ls()
> >
> > but arrived at the former MACRO_H position root gives me "segmentation
> > violation"
> >
> > I'd prefer to avoid gROOT->Reset() if possible because there are a lot
> > of circumstances that I want to delete my global variables without
> > resetting the environment.
> >
> > I use ROOT v4.00/04 binary version for Linux and gcc 3.3.2
>
> Is there any suggestion? Also this time it would
> be better to migrate to a new version?
> And in this case, it would be better to compile by
> myself?
>
> Regards
>
>
>
Received on Mon May 09 2005 - 09:03:50 MEST

This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:07 MET