delete trouble

Voropaev S.G. (voropaev@inp.nsk.su)
Sat, 5 Jul 1997 17:45:13 +0700


Dear ROOT people,
I have written the following code in file bad.cpp:
---------------------------------------------------------
class der : public TObject
{
public:
der()
{ printf("der constructor\n");}

~der()
{ printf("der destructor\n"); };
};
void bad()
{
der *p = new der;
delete p;
}
----------------------------------------------------------------
after start macro:
root [0] .x bad.cpp
I have this output:
der constructor
der destructor
and crash of ROOT program.

If I change string "class der : public TObject" to "class der", all work fine.

I use root 1.00/10 in Windows NT 4.0. It is legal to use class derived from
TObject
in interactive session? In documentation "Adding Your Own Classes to ROOT" I
find:

"If you are only interested in interactive access to your classes via the
command line or macro processor you do not need to use the ClassDef and
ClassImp macros."

Voropaev S.G.