[ROOT] Keeping histos visible without creating a memory leak

From: Suzanne Panacek (spanacek@fnal.gov)
Date: Tue Oct 03 2000 - 18:40:43 MEST


Hi,
The discussion on gROOT->Reset brought up another question.

When creating histograms on the stack in a named script, they disappear from
the canvas because the destructor is called when the function exits.
To prevent this, we create it on the heap instead. But, this creates a
memory leak, because the variable is no longer available.

How can I prevent the histogram from disappearing and exit my function
without having a memory leak?

Suzanne



This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:34 MET