Subject Re: [IBO] ib_connection.BeforeDisconect
Author Frank Ingermann
Hi Dominik,

Dominik Murk wrote:
> IBO 4.2.Eb, Delphi6 Enterprise.
> Before I close my form I call IB_CONNECTION.DISCONNECT.
> I do have 2 events: OnBeforedisconnect and OnAfterDisconnect but they aren't
> executet becouse in IBA_Connection.imp it says: 'if not ( csDestroying in
> ComponentState ) then ...' and my events isn't called becouse csDestroying
> is in ComponentState.
> Is that ok and if it is do i have to call manualy this events?
> Thanks,
> Dominik Murk

it seems you call IB_CONNECTION.DISCONNECT in the OnDestroy handler of
your form. Try to do it in OnCloseQuery or OnClose instead, as csDestroying
is not (yet) in ComponentState at that time. (and don't free your forms with
Free but with Release as this will handle events while closing/destroying
the form correctly)

regards & hth,

when parsers parse, and compilers compile, then why don't objects object?

fingerbirdy - fingerman's door to Firebird