-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1 If you also develop DLL, make sure both application and DLL put
sharemem at the first line of your project source. Just a thought.
Best Regards
Leigh Wanstead - ----- Original Message ----- From: Nigel Tavendale To: Multiple recipients of list delphi Sent: Thursday, January 13, 2000 11:12 AM Subject: Re: [DUG]: memory loss. Try putting the line StartProc:=nil;
in the finaly block before the free library call toi tell delphi
to
clear out the memory associated with the function. Also try explicity creating a PChar for the mofdule name and
then
removing it with FreeMem and GetMem rather then doing the cast. Hope this helps.
Nigel.
- ----- Original Message -----
From: Matthew Comb
To: Multiple recipients of list delphi
Sent: Wednesday, January 12, 2000 5:05 PM
Subject: [DUG]: memory loss.
Hello, I am loading in some dlls into my main application and have noticed I
am getting what I think is a 4k memory leak. At least according to the task manager. Everytime I load an application with the following procedure I
lose
memory. Can anyone spot anything? Cheers,
Matt.
type
TStartProc = procedure(AppHandle: HWND); stdcall; procedure StartProject1;
var DllHandle: HMODULE; StartProc: TStartProc; begin DllHandle := LoadLibrary(pchar(form1.edit1.text)); if DllHandle <> 0 then begin try StartProc := GetProcAddress(DllHandle, 'Start'); if Assigned(StartProc) then begin StartProc(Application.Handle); end else showmessage('notassigned'); finally form1.listbox1.items.add('Freeing library'); FreeLibrary(DllHandle); end; end else showmessage('the big zero'); end; The Rules Have Changed...Get Paid to Surf the Web!
http://www.alladvantage.com/go.asp?refid=ggz487 -----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 6.5.1 for non-commercial use <http://www.pgp.com> iQA/AwUBOHyBrecpyPm4rG9PEQL0tQCgmfZEJA8ysiZ3s2l3QqwRfLUsmbgAn3rE
R5tnqqHpmMsUxChR9SUKOy1q =Gc4Z -----END PGP SIGNATURE----- |
- [DUG]: memory loss. Matthew Comb
- Re: [DUG]: memory loss. Nigel Tavendale
- Leigh Wanstead