TsBoundLabel throws exception in destruction

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #37844
    HeDiBo
    Participant

    I have a TsDBText field with a BoundLabel property. When the program terminates I get the error from FastMM4 that a freed object had been used. The bug occurred in sCommonData.pas:

    Code:
    destructor TsBoundLabel.Destroy; begin
    if Assigned(FTheLabel) and not (csDestroying in FTheLabel.ComponentState) then
    FreeAndNil(FTheLabel); // <<<--- throws the already freed exception. FreeAndNil(FFont);
    inherited Destroy;
    end;

    This is the stack trace leading up to this problem:

    Code:
    :750dd722 KERNELBASE.RaiseException + 0x62 FastMM4.TFreedObject.VirtualMethodError
    System.TObject.Free
    sCommonData.TsBoundLabel.Destroy
    System.TObject.Free
    sDBText.TsDBText.Destroy
    Vcl.Controls.TWinControl.Destroy
    Vcl.Controls.TCustomControl.Destroy
    sPanel.TsCustomPanel.Destroy
    Vcl.Controls.TWinControl.Destroy
    Vcl.Controls.TCustomControl.Destroy
    sPanel.TsCustomPanel.Destroy
    Vcl.Controls.TWinControl.Destroy
    Vcl.Forms.TScrollingWinControl.Destroy
    frPoule.TfrPouleMembers.Destroy << This is the Destructor of my Frame
    Vcl.Controls.TWinControl.Destroy
    Vcl.ComCtrls.TTabSheet.Destroy
    sPageControl.TsTabSheet.Destroy << The tab sheet contains a frame
    Vcl.Controls.TWinControl.Destroy
    Vcl.ComCtrls.TCustomTabControl.Destroy
    Vcl.ComCtrls.TPageControl.Destroy
    sPageControl.TsPageControl.Destroy << The page control contains the tab sheet above
    Vcl.Controls.TWinControl.Destroy
    Vcl.Controls.TCustomControl.Destroy
    sPanel.TsCustomPanel.Destroy
    Vcl.Controls.TWinControl.Destroy
    Vcl.ComCtrls.TTabSheet.Destroy
    sPageControl.TsTabSheet.Destroy
    Vcl.Controls.TWinControl.Destroy
    Vcl.ComCtrls.TCustomTabControl.Destroy
    Vcl.ComCtrls.TPageControl.Destroy
    sPageControl.TsPageControl.Destroy << There are many page controls in my project containing other page controls
    Vcl.Controls.TWinControl.Destroy
    Vcl.Controls.TCustomControl.Destroy
    sPanel.TsCustomPanel.Destroy
    Vcl.Controls.TWinControl.Destroy
    Vcl.Forms.TScrollingWinControl.Destroy
    Competition.TfrCompetition.Destroy
    Vcl.Controls.TWinControl.Destroy
    Vcl.ComCtrls.TTabSheet.Destroy
    sPageControl.TsTabSheet.Destroy
    Vcl.Controls.TWinControl.Destroy
    Vcl.ComCtrls.TCustomTabControl.Destroy
    Vcl.ComCtrls.TPageControl.Destroy
    sPageControl.TsPageControl.Destroy << This is the master page control
    Vcl.Controls.TWinControl.Destroy
    Vcl.Forms.TScrollingWinControl.Destroy
    Vcl.Forms.TCustomForm.Destroy
    System.TObject.Free
    System.Classes.TComponent.DestroyComponents
    Vcl.Forms.DoneApplication
    System.SysUtils.DoExitProc
    System._Halt0

    WIP4.WIP4

    If I use a TsStickyLabel in stead, there's no problem a1.gif

    When searching for the cause of this bug I came up with this Resources used after Destroy It Had nothing to do with this bug, but still a useful finding, I think.

    #57951
    Support
    Keymaster

    Thank you for a report, I will check it.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.