Hi Rob -
Thanks! Inline...

--- In [email protected], Rob Kennedy <rkenn...@...> wrote:
>
> 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?)
No, what are the implications?

Short for packet, a 'bundle' of data sent/received by radio. An error free 
protocol as well.

> 
> > 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?
> 

frmPkt's isn't (of course) when the main form is closed. DOH!

> 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

That did it. Happydance! What's left leakwise is in a unit (not my code - Jan 
Goyvaerts) for implementing .chm help. Do you have any recommendations for that?

Again, thanks.




Reply via email to