int script()
{
TH1F *h = new TH1F("h1name", "h1name", 11, -5, 5);
h -> FillRandom("gaus", 100);
return 0;
}
I run the script as .x script.cc
Is there a general root command to call delete on dynamically allocated TH1*, to be used after the reference h has run out of scope? And a general command to delete all dynamically allocated objects (clear memory)?
The purpose of gROOT->Reset() is to (attempt) to completely undo all the operation done so far. I.e. if that is what you need, you may as well quit the session and restart