Deleting TGlobal objects from memory

From: Germano Percossi <germano.percossi_at_roma2.infn.it>
Date: Wed, 04 May 2005 15:33:05 +0200


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
--

     \ | /
     (@ @)

-o00-(_)-00o------------


Germano Percossi
University of Rome "Tor Vergata" and INFN Roma2 Via della Ricerca Scientifica 1
I-00133 Rome Italy
Phone     : 06 7259 4824
Room      : c0 28b

------------------------------------------------------------
Received on Wed May 04 2005 - 15:37:22 MEST

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