Project JEDI - Issue Tracker
Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0003824 [JEDI VCL] 00 JVCL Components major always 2006-07-23 13:20 2006-07-24 01:08
Reporter altera View Status public  
Assigned To obones
Priority normal Resolution fixed  
Status resolved   Product Version 3.20
Summary 0003824: Memory leak on FUrlGrabberThread
Description The JvUrlListGrabber file contains a repeating memory leak in the TJvHttpUrlGrabberThread class. Every time something was downloaded a leak of 92 bytes is generated. This was found with fastmm4. The fix for this bug is here:

procedure TJvCustomUrlGrabber.Stop;
begin
  if Assigned(FUrlGrabberThread) then
  begin
    // If there is a thread, terminate it and let it destroy
    // itself as we don't need it anymore

    FUrlGrabberThread.WaitFor();
    FUrlGrabberThread.Free;

  end;
end;

Before it was settings FreeOnTerminate to true and then terminating the thread. For some reason this doesn't actually free the thread. Probably because the thread has already terminated by the time the call to terminate comes in.

Ron
Additional Information
Tags No tags attached.
Attached Files

- Relationships

-  Notes
(0009844)
obones (administrator)
2006-07-24 01:07

This is now fixed in SVN, but please note that calling WaitFor like you did is a recipe for disaster as it will wait until the thread has finished the download while Stop is meant to abort the currently running one.
Hence the call to WaitFor should be replaced by a call to Terminate. The destructor from TThread will actually wait for the thread to be finished.

- Issue History
Date Modified Username Field Change
2006-07-23 13:20 altera New Issue
2006-07-23 13:24 altera Issue Monitored: altera
2006-07-24 01:07 obones Status new => resolved
2006-07-24 01:07 obones Fixed in Version => Daily / SVN
2006-07-24 01:07 obones Resolution open => fixed
2006-07-24 01:07 obones Assigned To => obones
2006-07-24 01:07 obones Note Added: 0009844


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker