I am getting an access violation when deleting a TsCheckBox.
I have a dynamically generated form with TsCheckBox and an “Apply” button that is the default.
If I click the Apply button then the form closes and the TsCheckBox is deleted without issue.
If I press enter the Apply button’s OnClick triggers and the form closes but the TsCheckBox throws an access violation in WndProc when handling WM_KILLFOCUS or CM_EXIT.
Tracing it though I can see the TsCheckBok.Destroy is called and deletes fCommonData and then calls the inherited Destroy which in turn calls the WndProc which then tries to update the fCommonData.
Moving the FreeAndNil for fCommonData to after the inherited solves the problem.
P.S. Is there a reason why you have FImageChangeLink.Free rather than FreeAndNil(FImageChangeLink) in the Destroy?