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
0003093 [JEDI VCL] 00 JVCL Components major always 2005-07-15 07:41 2005-08-09 06:50
Reporter anonymous View Status public  
Assigned To outchy
Priority normal Resolution fixed  
Status resolved   Product Version 3.00
Summary 0003093: JvHTMLParser
Description It 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 Information I'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.
Tags No tags attached.
Attached Files

- Relationships

-  Notes
(0007571)
outchy (administrator)
2005-07-19 13:26

The changes will be committed into the CVS repository.
(0007713)
obones (administrator)
2005-08-09 06:42

Any news on this ?
If it is in CVS, please change the status to resolved.
(0007714)
outchy (administrator)
2005-08-09 06:50

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


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