Re: name for histograms

From: Axel Naumann <Axel.Naumann_at_cern.ch>
Date: Mon, 26 Jun 2006 23:41:07 +0200


Hi,

someone has to delete an objects that got created via new. In the cases you refer to the directory serves as a fall-back. The histogram / directory relation has some tradition e.g. in PAW.

Axel.

OKUMURA, Akira wrote:
> Hello Brett,
>
> Thank you very much.
>
> Could you tell me demerits of using

>>   hist->SetDirectory(0);

> if any.
>
> I do not understand why only histogram (and some other class) uses
> special 'owner' system. In other words, I do not know the merit of being
> owned by a directory.
>
> Sincerely,
>
> OKUMURA, Akira oxon_at_icrr.u-tokyo.ac.jp
> Institute for Cosmic Ray Research, University of Tokyo
> 5-1-5 Kashiwanoha Kashiwa Chiba 277-8582 Japan
> Phone/Fax : +81 4-7136-3153
> Skype : okumura.akira
>
> On 2006/06/15, at 23:23, Brett Viren wrote:
>
>> "OKUMURA, Akira" <oxon_at_icrr.u-tokyo.ac.jp> writes:
>>
>>> If I make a class which has histogram as a member as below, at the
>>> line of declaration of 'MyClass b' ROOT warns 'Potential memory leak'.
>>
>> If you don't want ROOT to track your histograms (which is what is
>> behind this "Potential memory leak" message) then call
>>
>>   hist->SetDirectory(0);
>>
>> after you create it.
>>
>> -Brett.
>>
>>

>
Received on Mon Jun 26 2006 - 23:41:14 MEST

This archive was generated by hypermail 2.2.0 : Mon Jan 01 2007 - 16:31:59 MET