• Welcome to Forum.Deepsoftware.Com. Please login or sign up.
 

FASTMM Detected memory Leak

Started by DigitalCat, March 27, 2010, 09:57:29 pm

Previous topic - Next topic

DigitalCat

March 27, 2010, 09:57:29 pm Last Edit: March 27, 2010, 09:59:06 pm by DigitalCat
Hello,
WinXp + Delphi2007
We constantly get an access violation when we try to close
the port with an "nrcomm.active:=false;" statement.
FastMM message is Next.
-----------------------------------------------------------------------------------------------------
Freed object class: TnrComm

Virtual method: Offset +48

Virtual method address: 4B73A4

The allocation number was: 2597

The object was allocated by thread 0xC04, and the stack trace (return addresses) at the time was:
403116 [System][@GetMem]
404573 [System][TObject.NewInstance]
42428D [Classes][CreateComponent]
424509 [Classes][TReader.ReadComponent]
424EAF [Classes][TReader.ReadProperty]
4259D9 [Classes][TReader.ReadValue]
4247BA [Classes][TReader.ReadDataInner]
4246F9 [Classes][TReader.ReadData]
4294FE [Classes][TComponent.ReadState]
45D0B6 [Controls][TControl.ReadState]
460F7E [Controls][TWinControl.ReadState]

The object was subsequently freed by thread 0xC04, and the stack trace (return addresses) at the time was:
403132 [System][@FreeMem]
404591 [System][TObject.FreeInstance]
404985 [System][@ClassDestroy]
4BAF89 [nrcomm.pas][nrcomm][TnrCustomSerialComm.Destroy][1657]
429118 [Classes][TComponent.Destroy]
45CE01 [Controls][TControl.Destroy]
404591 [System][TObject.FreeInstance]
404985 [System][@ClassDestroy]
4202B5 [Classes][TPersistent.Destroy]
460E6E [Controls][TWinControl.Destroy]
472A39 [Forms][TScrollingWinControl.Destroy]

The current thread ID is 0xBB8, and the stack trace (return addresses) leading to this error is:
4B73A1 [nrclasses.pas][nrclasses][TnrBaseIO.GetActive][955]
4B99B2 [nrcomm.pas][nrcomm][TMsgThread.Execute][557]
428AAB [Classes][ThreadProc]
405462 [System][ThreadWrapper]
7C80B729 [Unknown function at GetModuleFileNameA]

--------------------------------------------------------------------------------------------------
My code;
procedure TControlfrm.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
  if nrComm1.Active = True then nrComm1.Active:= False;
end;
-------------------------------------------------------------------------------------------------
Do you have any idea why this can be?

Roman Novgorodov

Hello

Thank you for your information.

We can't reproduced your exception.
All works fine.
We created a simple project with empty form, TnrComm instance and following code:


implementation

{$R *.dfm}

procedure TForm1.FormShow(Sender: TObject);
begin
  nrComm1.Active := True;
end;

procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
  nrComm1.Active := False;
end;

end.


Please describe more details and upload here simple demo that reproduce exception.

Also we need to know:
1) Windows version
2) Delphi version
3) nrComm version and edition (trial or full?)

Roman Novgorodov
DeepSoftware.Com
DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.