nf4lham wrote: > I'm using FastMM4 with D7, and it's reporting some memory leaks I don't > understand. From the report: > This block was allocated by thread 0x7C4, and the stack trace (return > addresses) at the time was: > 402EBC [syste...@getmem] > 4B25D7 [Forms][TCustomForm.DoCreate] > 4B22B7 [Forms][TCustomForm.AfterConstruction] > 603EBD [LogBk.pas][LogBk][TfrmLog.mnuClusterClick][3935] > 4AB514 [Menus][TMenuItem.Click] > 4B4F19 [Forms][TCustomForm.Activate] > 49D344 [Controls][TWinControl.WndProc] > 49CFBF [Controls][TWinControl.MainWndProc] > 455256 [Classes][StdWndProc] > 7E418734 [Unknown function at GetDC] > 7E418816 [Unknown function at GetDC] > The block is currently used for an object of class: TDXDAliasRec > > This is line 3935 from frmLog (main form) > > if frmPKT = nil then > frmPKT := TfrmPKT.Create(self);
Is there a particular reason the pkt form needs to be owned by the log form? (What's a pkt, anyway?) > frmPKT is freed in the close event of frmLog > > TDXDAliasRec is created in TfrmPkt.Create and freed in TfrmPkt.FormClose. Are you sure both the forms' OnClose events fired? If you create something in the constructor, it's typical to balance that by freeing it in the destructor. Constructors and destructors form a logical pair. Set breakpoints at the entrances and exits of the destructors and OnClose event handlers of the classes in question to see what order they occur in. -- Rob

