delete trouble

From: Voropaev S.G. (voropaev@inp.nsk.su)
Date: Sat Jul 05 1997 - 12:45:13 MEST


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.



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