Subject Re: [IBO] TIB_Events
Author Helen Borrie
At 12:37 PM 25/07/2006, you wrote:
>Hi
>
>I have setup a TIB_Events for each 'Company' managed by our
>application. It is working great, in that it triggers correctly and
>runs just fine. However (most times) when I close the app I get a
>GDS32.dll error. It seems to be triggering when I disconnect from the
>database, although I cannot be 100% sure. Can anybody offer some
>suggestions.

It would be a help if you would say what the error is.


>In the TCompany destructor ...
>
>
> fIb_Events.OnEventAlert := Nil;
>
> if (DataBase.Connected = True) then begin
> if (fIb_Events.Registered = True) then begin
> fIb_Events.UnregisterEvents;
> end;
> end;
>
> fIb_Events.IB_Connection := Nil;

This sets the application's connection to Nil!!!

> fIb_Events.Free;
>
>....
>
> DataBase.Connected := False;
> DataBase.Free;

You then refer to this nil'ed out connection. Ka-boom!

If the "error" you are getting is an AV, then here is the cause.

Helen