View Issue Details

IDProjectCategoryView StatusLast Update
0003093JEDI VCL00 JVCL Componentspublic2005-08-09 06:50
ReporteranonymousAssigned Tooutchy 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.00 
Target VersionFixed in Version3.10 
Summary0003093: JvHTMLParser
DescriptionIt seems that there is a memory leak in the JvHTMLParser.

The FKeys stringlist is assigned a TParserInfo Object. However, there are several locations where the elements of the FKeys are cleared or deleted or freed (Destroy event) and the associated objects aren't freed.
Additional InformationI've made the following changes to my source and include them here for your reference.

destructor TJvHTMLParser.Destroy;
var
  i: Integer;
begin
  FParser.Free;

  //Free associated objects prior to clearing the list
  for i := 0 to FKeys.Count - 1 do
    FKeys.Objects[i].Free;
  FKeys.Free;

<snip>
end;


procedure TJvHTMLParser.SetParser(Value: TStrings);
var
  I: Integer;
  Obj: TJvParserInfo;
  Cap: string;
begin
  if FParser <> Value then // make sure we don't assign to ourselves (that will clear the list)
    FParser.Assign(Value);

  //Free associated objects prior to clearing the list
  for i := 0 to FKeys.Count - 1 do
    FKeys.Objects[i].Free;
  FKeys.Clear;
  
  I := 0;
<snip>


procedure TJvHTMLParser.RemoveCondition(Index: Integer);
begin
  //Free associated objects prior to clearing the list
  FKeys.Objects[Index].Free;
  FKeys.Delete(Index);
end;


procedure TJvHTMLParser.ClearConditions;
var
  i: Integer;
begin
  FParser.Clear;

  //Free associated objects prior to clearing the list
  for i := 0 to FKeys.Count - 1 do
    FKeys.Objects[i].Free;
  FKeys.Clear;
end;

These changes seem to remove the memory leaks.
TagsNo tags attached.

Activities

outchy

2005-07-19 13:26

administrator   ~0007571

The changes will be committed into the CVS repository.

obones

2005-08-09 06:42

administrator   ~0007713

Any news on this ?
If it is in CVS, please change the status to resolved.

outchy

2005-08-09 06:50

administrator   ~0007714

It was fixed in the CVS.

Issue History

Date Modified Username Field Change
2005-07-15 07:41 anonymous New Issue
2005-07-19 13:26 outchy Note Added: 0007571
2005-07-19 13:26 outchy Status new => confirmed
2005-07-19 13:37 outchy Status confirmed => feedback
2005-08-09 06:42 obones Note Added: 0007713
2005-08-09 06:50 outchy Status feedback => resolved
2005-08-09 06:50 outchy Resolution open => fixed
2005-08-09 06:50 outchy Assigned To => outchy
2005-08-09 06:50 outchy Note Added: 0007714