[yunqa.de] App hangs if HtmlTagFilters not freed

  • From: David Marcus <davidmarcus@xxxxxxxxxxxx>
  • To: yunqa@xxxxxxxxxxxxx
  • Date: Thu, 20 Jun 2019 07:24:41 -0400

If you forget to free HtmlTagFilters, the app hangs. To reproduce this,
compile and run the code below. If you uncomment the line, then it does not
hang. I'm using Delphi 10.3 and DIHtmlParser 7.12.0.

{$Align 8}
{$Assertions on}
{$BoolEval off}
{$DebugInfo on}
{$ExtendedSyntax on}
{$Hints on}
{$IOChecks on}
{$LocalSymbols on}
{$LongStrings on}
{$MinEnumSize 1}
{$OverflowChecks on}
{$RangeChecks on}
{$SafeDivide off}
{$StackFrames off}
{$TypedAddress on}
{$VarStringChecks on}
{$Warnings on}
{$WriteableConst off}
{$Optimization off}
{$apptype console}
program TestDIHtml;
uses
   DIHtmlParser;
type
   WebpageParser = class
      strict private
         HtmlParser: TDIHtmlParser;
      public
         constructor Create;
         destructor Destroy; override;
   end;
constructor WebpageParser.Create;
begin
   inherited;
   HtmlParser                := TDIHtmlParser.Create( nil );
   HtmlParser.HtmlTagFilters := TDITagFilters.Create;
end;
destructor WebpageParser.Destroy;
begin
   // HtmlParser.HtmlTagFilters.Free;
   HtmlParser.Free;
   inherited;
end;
var
   Parser: WebpageParser;
begin
   Parser := WebpageParser.Create;
   Parser.Free;
end.

_______________________________________________
Delphi Inspiration mailing list
yunqa@xxxxxxxxxxxxx
//www.freelists.org/list/yunqa



Other related posts: