Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


ID: 18735, VCL: FreeObjectInstance fix of Memory Leak

by Dmitry Burov Email: Anonymous


FreeObjectInstance generates 4kb RAM leak. Aspecially with forms in DLL.
Download Details
FTP  download also available 0 bytes
CDN Login Required to Download. (You will be redirected to the login page if you click on the Download Link)
To download this, you must have registered:
A free membership

For Delphi, Version 1.0  to 6.0 10 downloads
Copyright: No significant restrictions


Size: 0 bytes
Updated on Thu, 15 Aug 2002 03:52:00 GMT
Originally uploaded on Thu, 15 Aug 2002 03:49:36 GMT
Description
1st of all i must apologise if i had invented a brand-new bycicle :-)
But i didn't see a thing before, so may be it is new indeed.

It seems that Make... and FreeObjectInstance were not finished until release of Delphi 1 and was never completed after that.

Surfing through Russian FidoNet Delphi echo i've run to a topic of memory leak of 4Kb at each forms creating|freeing.
As far as i understand it was about creating forms in DLL and using them in host EXE.
It was a not-too-huting bug in usual apps, but rithing services that must
work 24x7 was a nightmare!

It seems that blamed procedure is FreeObjectInstance - heavy used by VCL,
but misty and undocumented.
I've seen a workarounds, when DLL accounted the leaked RAM and free it on
unload...
Jeez!

Ok, so i tried to bring together all the ideas from that thread and make
them into a single patch.
Plz, have a look and fix all the bugs i made - i sure must made at least
one!

Thanks to everyone envolved.

For more information, see http://Arioch.nm.ru/Delphi/ObjInstFix.pas

   Latest Comments  View All Add New

Move mouse over comment to see the full text

Could not retrieve comments. Please try again later.

Server Response from: ETNACDC04