deleting hist from memory

From: Boris Skorodumov <bskorodo_at_nd.edu>
Date: Thu, 17 Mar 2005 08:17:30 -0500


dear rooters,

i have simple question:

suppose i created in memory several 1d and 2d histogram. {via TH1D *h = new TH1D("h",..... ) ....}
after that im filling them with some criteria. Finally i am deleting them from memory. Now i whould like to run script again to do the same procedure. Just to be save, i am trying in script delete all of the histograms in memory via next script:  

   TIter nextkey(gDirectory->GetListOfKeys());    TKey *key;   

   while (key = (TKey*)nextkey()) {   

      TObject *obj = key->ReadObj();
       if ( obj->IsA()->InheritsFrom( "TH2" ) || 
obj->IsA()->InheritsFrom( "TH1" ))
       obj->Delete();
    

   }

but still i see all OBJ in memory. is it something wrong ?

thank you,

boris.

-- 
--------------------------------------

| Boris Skorodumov, Graduate Student |
| Physics Department |
| University of Notre Dame |
| Indiana 46556, USA |
| WWW: http://www.nd.edu/~bskorodo |
--------------------------------------
Received on Thu Mar 17 2005 - 14:17:40 MET

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