Memory Leak in TIdReplySMTP

Giganews Newsgroups
Subject: Memory Leak in TIdReplySMTP
Posted by:  jyl (jy.lin…@calystene.com)
Date: Wed, 6 Jun 2007

Hi,
As it seams impossible to report bug now, I use this place to give this information (let me know if there is any better way to do that) :

constructor TIdReplySMTP.Create(ACollection: TIdCollection);  // constructor A
begin
  inherited Create(ACollection);
  FEnhancedCode := TIdSMTPEnhancedCode.Create;
end;

constructor TIdReplySMTP.Create(ACollection: TIdCollection; AReplyTexts: TIdReplies);  // constructor B
begin
  inherited Create(ACollection, AReplyTexts);
  FEnhancedCode := TIdSMTPEnhancedCode.Create;
end;

FEnhancedCode is created twice when constructor B is called, as inherited CreateB call CreateA which is virtual.

jyl

Replies