Memory leaks

Hi all,
I'm using 5.3.2, the latest as of Dec 2000, and am having problems with
memory leaks. I have had a qwik search through the archives re: leaks but
didn't find a great amount of detail, hence my post.
Below are 4 stack traces of where I believe there are a few leaks, followed
by a modification I made to HTProfile_delete() which cleared up a bunch of
other ones I found at the top level. (I made some other minor changes as
well which should become obvious if you tried the additional code as below,
re crashes when start-terminate multiple times)
I saw reference to one of the leaks below in the list I think, the one where
a timer is being allocated in HTHost_free() during HTTP cleanup.
Does anyone have any further information on reducing/eliminating memory
leaks for post 5.3.2 source code? Does the latest in CVS fix any of these?
Thanks,
Owen Roberts
--
Owen Roberts
Baltimore Technologies
oroberts@baltimore.com


HTAtom_for() 2 leaks
HTMemory_malloc(unsigned int 12) line 68 + 21 bytes
HTAtom_for(const char * 0x005a5380 `string') line 67 + 21 bytes
HTAnchor_clearHeader(_HTParentAnchor * 0x00430a08) line 1378 + 10 bytes
delete_parent(_HTParentAnchor * 0x00430a08) line 336 + 9 bytes
delete_family(_HTAnchor * 0x00430a08) line 379 + 9 bytes
HTAnchor_deleteAll(_HTList * 0x00000000) line 400 + 9 bytes
HTLibTerminate() line 194 + 7 bytes
HTProfile_delete() line 57

SockEvents_get() 2 leaks
HTMemory_calloc(unsigned int 1, unsigned int 8) line 88 + 25 bytes
HTList_addObject(_HTList * 0x00441c28, void * 0x00441c70) line 45 + 9 bytes
SockEvents_get(unsigned int 484, int 0) line 269 + 20 bytes
HTEventList_register(unsigned int 484, int 327712, _HTEvent * 0x00437440)
line 412 + 11 bytes
HTEvent_register(unsigned int 484, int 327712, _HTEvent * 0x00437440) line
60 + 18 bytes
HTHost_register(_HTHost * 0x00437138, _HTNet * 0x00436498, int 262160) line
1462 + 30 bytes
HTDoConnect(_HTNet * 0x00436498) line 318 + 18 bytes
HTHost_connect(_HTHost * 0x00437138, _HTNet * 0x00436498, char * 0x004361a8)
line 1316 + 9 bytes
HTTPEvent(unsigned int 4294967295, void * 0x00436ec8, int 393216) line 1066
+ 26 bytes
HTLoadHTTP(unsigned int 4294967295, _HTRequest * 0x00423b28) line 974 + 18
bytes
HTNet_newClient(_HTRequest * 0x00423b28) line 808 + 9 bytes
HTLoad(_HTRequest * 0x00423b28, int 0) line 1694 + 9 bytes
launch_request(_HTRequest * 0x00423b28, int 0) line 80 + 13 bytes
HTLoadToChunk(const char * 0x00423ac1, _HTRequest * 0x00423b28) line 192 +
11 bytes


HTHost_setClass
HTMemory_malloc(unsigned int 5) line 68 + 21 bytes
HTSACopy(char * * 0x00437148, const char * 0x0068435c `string') line 117 +
21 bytes
HTHost_setClass(_HTHost * 0x00437138, char * 0x0068435c `string') line 499 +
28 bytes
HTTPEvent(unsigned int 484, void * 0x00436ec8, int 262160) line 1083 + 14
bytes
HostEvent(unsigned int 484, void * 0x00437138, int 262160) line 240 + 39
bytes
HTEventList_dispatch(unsigned int 484, int 262160, unsigned long 435651373)
line 581 + 21 bytes
AsyncWindowProc(HWND__ * 0x000c0762, unsigned int 1024, unsigned int 484,
long 16) line 838 + 17 bytes

HTHost_free
HTMemory_calloc(unsigned int 1, unsigned int 8) line 88 + 25 bytes
HTList_new() line 21 + 9 bytes
HTTimer_new(_HTTimer * 0x00000000, int (_HTTimer *, void *, int)* 0x0057eb20
IdleTimeoutEvent(_HTTimer *, void *, int), void * 0x00437138, unsigned long
60000, int 1, int 0) line 200 + 5 bytes
HTHost_free(_HTHost * 0x00437138, int 200) line 1134 + 26 bytes
HTHost_deleteNet(_HTHost * 0x00437138, _HTNet * 0x00436498, int 200) line
1155 + 13 bytes
HTNet_delete(_HTNet * 0x00436498, int 200) line 911 + 20 bytes
HTTPCleanup(_HTRequest * 0x00423b28, int 200) line 171 + 13 bytes
HTTPEvent(unsigned int 484, void * 0x00436ec8, int 1) line 1270 + 16 bytes
HostEvent(unsigned int 484, void * 0x00437138, int 1) line 197 + 33 bytes
HTEventList_dispatch(unsigned int 484, int 1, unsigned long 435769433) line
581 + 21 bytes
AsyncWindowProc(HWND__ * 0x00160762, unsigned int 1024, unsigned int 484,
long 1) line 838 + 17 bytes


After modifying HTProfile_delete() as below

   PUBLIC void HTProfile_delete (void)
   {
       if (!preemptive) HTEventTerminate();
       if (HTLib_isInitialized()) {
   
   	/* Clean up the persistent cache (if any) */
   	HTCacheTerminate();
   
   	/* Clean up all the global preferences */
   	HTFormat_deleteAll();
   
   	/* The following lists have been cleaned up by HTFormat_deleteAll */
   	transfer_encodings = 0;
   	content_encodings = 0;
   	converters = 0;
   
   	/* Remove bindings between suffixes, media types */
   	HTBind_deleteAll();
->     
->     
->     HTAlert_deleteAll();
->     HTTransport_deleteAll();
->     HTNet_deleteAll();
->     HTHeader_deleteAll();
->     HTIcon_deleteAll();
->     HTRule_setGlobal(NULL);
->     HTAA_deleteAllModules();
   
   	/* Terminate libwww */
   	HTLibTerminate();
       }
   }




-----------------------------------------------------------------------------
The information contained in this message is confidential and is intended
for the addressee(s) only.  If you have received this message in error or
there are any problems please notify the originator immediately.  The 
unauthorised use, disclosure, copying or alteration of this message is 
strictly forbidden. Baltimore Technologies plc will not be liable for
direct, special, indirect or consequential damages arising from alteration
of the contents of this message by a third party or as a result of any 
virus being passed on.

This footnote confirms that this email message has been swept for Content
Security threats, including computer viruses.
http://www.baltimore.com

Received on Tuesday, 16 April 2002 07:23:09 UTC