From: wvdbos@... Date: 2004-10-14T01:28:35+09:00 Subject: Memory leak in mswin32 implementation I'm making a program that uses ruby as a scripting language. The main program is written in Borland and I use the mswin32 version of ruby. The dll is loaded using LoadLibrary and freed with FreeLibrary. typedef void (*Truby_init )(); typedef void* (*Truby_cleanup )(int); Truby_init ruby_init ; Truby_cleanup ruby_cleanup ; HINSTANCE RubyDll=LoadLibrary("msvcrt-ruby18.dll"); ruby_init =(Truby_init )::GetProcAddress(RubyDll,"ruby_init"); ruby_cleanup =(Truby_cleanup)::GetProcAddress(RubyDll,"ruby_cleanup"); ruby_init(); ruby_cleanup(0); FreeLibrary(RubyDll); After the FreeLibrary there is a memory loss of about half a meg :-( When using 'bccwin32-ruby18.dll' this doesn't happen. It looks like borland automatically frees all memory! This sample is stripped down to it's basics. But in my own version there are also threads left running. And again they are killed when using the borland version. In the ideal situation ruby_cleanup should free all resources. But third party programmers might be sloppy. Thats the reason I free the dll. So isn't there a way of telling Visual to free up all resources? Thnx