Destructor of a TFrame with an Event<> that is used from a parent form causes an AV

Issue #57 resolved
Former user created an issue

Steps: 1. Put a TFrame on a TForm 2. Add an Event<TNotifyEvent> to the TFrame 3. Add a form's event handler to the frame 4. Use FastMM4 in FullDebugMode

The application will raise an access violation upon destroying the TFrame. Please see the attached sample project and FastMM configuration file.

My callstack is

System.Classes.{System.Generics.Collections}TList<System.Classes.TComponent>.IndexOf(???)
 System.Classes.{System.Generics.Collections}TList<System.Classes.TComponent>.Remove(???)
 System.Classes.TComponent.RemoveNotification($9672)
 System.Classes.TComponent.RemoveFreeNotification($7EF3A7D0)
 System._IntfClear(???)
 :004CE51F System::Generics::Collections::TList__1<System::Classes::TComponent *>::IndexOf(????) 

A possible workaround seems(!) to call Event<>::Clear() in the owners (TFrame) destructor.

PS: I haven't used Debug DCUs for Spring so the callstack is probably not helpful at all.

Comments (7)

  1. Log in to comment