RE: [ROOT] Overlapping TObjects?

From: Philippe Canal (pcanal@fnal.gov)
Date: Thu Apr 04 2002 - 00:10:32 MEST


Hi Simon,

Theoritically, since you create a new object and do set the value to 0,
it should still be zero at the end of the constructor.  However (and I
do not have enough information to guess properly) there are many situations
were this could happen, all depend on your actual code.  Some of this 
situations included one where the pointer you are using is not refreshed to
the new address, some other objects has kept a pointer to the old object
(eventhough it was deleted) and is using it and writing stuff in it,
or the constructor is not executed eventhough you thought it should, etc........

More concretely, how do you destroy the object, how do you create the
new object, how do you check/print the new value.

Cheers,
Philippe.

PS. A priori the ROOT system does not hold any information about your
object and should not be a factor in this situtation ....

-----Original Message-----
From: owner-roottalk@pcroot.cern.ch
[mailto:owner-roottalk@pcroot.cern.ch]On Behalf Of Simon Dean
Sent: Wednesday, April 03, 2002 3:37 PM
To: roottalk@pcroot.cern.ch
Subject: [ROOT] Overlapping TObjects?


Hi there,

I have a class that inherits from TObject. If I destroy one instance of
this class and make a new one, is there any possibility that some of the
member variables from the first instance are somehow kept in the ROOT
system and re-used in the next instance?

Specifically, I have a class called 'SDAQ' (inherited from TObject) which
has a member variable 'numHDI'. When I make a new SDAQ, I set numHDI to
0. However, when I print numHDI out after the constructor has occurred, it
still has the old value from the previous SDAQ. Puzzling...........

cheers,

Simon 



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:48 MET