[ROOT] Memory Leakage and TMessage

From: Thomas Eberl (teberl@physik.tu-muenchen.de)
Date: Mon May 08 2000 - 13:35:24 MEST


Dear rooters,

i work with 2.23/12 under RedHat6.0 on a PII-400.

I have looked to the Client/Server Example and I try to send my own
objects that are derived from TObject between two computers. It works
fine, but I don't know how to delete the received object in a clean way.
I want to assign the received object to a data member of my "data
receiving" class to be able to use it somewhere else in the code. If I
just copy the pointer everyhting works fine, but the memory consumption
grows as long as the program runs until it crashes.
----------- 
} else if (mess->What() == kMESS_OBJECT) {
	    printf("got object of class: %s\n", mess->GetClass()->GetName());
	    HMatrixCategory * catmHRichRawtmp = (HMatrixCategory *)
mess->ReadObject(mess->GetClass());
catmHRichRaw = catmHRichRawtmp;
-----------
on the other hand, if I delete catmHRichRawtmp my data is gone
obviously.

Why is it necessary anyway to delete this object ? Is there another way
to program it ?
Do I have to copy all the data into another object to save it ?

Please help

Thomas 
-- 
Thomas Eberl                       Phone: (+49 89) 289 1 2429   
Physik-Department E12, Technische Universitaet Muenchen
James-Franck-Strasse *** D-85748 Garching b. Muenchen
Email: Thomas.Eberl@physik.tu-muenchen.de



This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:24 MET