View Issue Details

IDProjectCategoryView StatusLast Update
0003824JEDI VCL00 JVCL Componentspublic2006-07-24 01:08
ReporteralteraAssigned Toobones 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.20 
Target VersionFixed in Version3.30 
Summary0003824: Memory leak on FUrlGrabberThread
DescriptionThe 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
TagsNo tags attached.

Activities

obones

2006-07-24 01:07

administrator   ~0009844

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-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