Board index » delphi » Program is crashing! Please help!

Program is crashing! Please help!

Hi!

I have a COM Server application and a COM Client.
The Client pools the server every second.
The sequence in server is like this:

...in initialize procedure
ASession.Create
ASession.AutoSessionName=True
ASession.Active

AQuery.Create
AQuery.SessionName = ASession.SessionName
...end initialize

...a function from the Server
AQuery.Select Count(*)
AQuery.Active = True
AQuery.Active = False
AQuery.UnPrepare
...end function

...destroy destructor
ASession.Close -------------------- (IN THIS LINE I HAVE A CRASH)
ASession.Free

AQuery.Active=False
AQuery.Free
...end destroy

In the upper marked line I get an Access Violation
and even if I put a TRY EXCEPT statement the program terminates itself.

Anybody can help me?
What do I do wrong?

Thanks in advance
Mario

 

Re:Program is crashing! Please help!


Quote
"Mario" <m.dam...@gantner.com> wrote in message <news:3c05f2e1_2@dnews>...
> ...destroy destructor
> ASession.Close -------------------- (IN THIS LINE I HAVE A CRASH)
> ASession.Free

> AQuery.Active=False
> AQuery.Free
> ...end destroy

I don't see how it would cause your problem, but shouldn't you close
and free the query first. It is still using the session object when
you free it.

Marc

Other Threads