TDirectory problem

From: Nick van Eijndhoven (Nick@phys.uu.nl)
Date: Fri Jan 08 1999 - 17:10:14 MET


Dear ROOTers,
I encountered the following crash in ROOT 2.20/06 on windows95.

I have a class Aap in which 
 
protected:
 TH1F* histo;
private:
 TDirectory* fDir;

are datamembers.
In the default constructor I do 

Aap::Aap()
{
 fDir=gDirectory->mkdir("Aap","test directory");
 histo=0; 
}

whereas I have also the public memberfunctions

void Aap::Fill()
{
 fDir->cd();
 histo=new TH1F(........); 
 .... // some code to fill the histogram 
}
void Aap::Dir()
{
 fDir->ls();
} 

To test my code I have the following ROOT macro

// macro test.C
{
  gSystem->Load("Aap.dll");

  Aap p;
  p.Fill();
  Aap q;
  q.Fill();
}

The following ROOT session crashes :

Root> .x test.C
Root> q.Dir() // works ok
Root> p.Dir() // ROOT crashes with a pagefault in ROOT_BASE

when I use
Root> gDirectory->ls()

it also shows me only the directory for q.

I have the feeling that the problem is related to the fact that
I create 2 directories with the same name by creating 2 objects
of the same class.

Can anyone tell me what is wrong here and how I can cure it ?
-- 

                                              Cheers,

                               _/_/      _/    _/   _/_/_/_/    _/   _/
                              _/  _/    _/    _/   _/          _/  _/
                             _/    _/  _/    _/   _/          _/_/
                            _/      _/_/    _/   _/          _/  _/
                           _/        _/    _/   _/_/_/_/    _/    _/


*----------------------------------------------------------------------*
 Dr. Nick van Eijndhoven                Department of Subatomic Physics
 email : nick@phys.uu.nl                Utrecht University / NIKHEF
 tel. +31-30-2532331 (direct)           P.O. Box 80.000
 tel. +31-30-2531492 (secr.)            NL-3508 TA Utrecht
 fax. +31-30-2518689                    The Netherlands
 WWW : http://www.phys.uu.nl/~nick      Office : Ornstein lab. 172
 ----------------------------------------------------------------------
 tel. +41-22-7679751 (direct)           CERN PPE Division / ALICE exp.
 tel. +41-22-7675857 (secr.)            CH-1211 Geneva 23
 fax. +41-22-7679480                    Switzerland
 CERN beep : 13+7294                    Office : B 160 1-012
*----------------------------------------------------------------------*



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:43:27 MET