Acess violation on aync calls

I’m having a lot of acess violations in a test case scenario where i have 10 clients doing 100 async calls. Debugging your code i found the reason for it.

Please check your follow lines:

destructor TROAsyncProxy.Destroy;
begin
//Todo: important: we MUST wait for and free the worker thread here!!!

when you create the dispach thread at:

procedure TROAsyncProxy.__DispatchAsyncRequest(const iMethodName:string; iRequest:TStream; iGetResponse:boolean=true);

TROAsyncProxyThread.Create(Self,Format(‘TROAsyncProxyThread for %s calling %s’,[ClassName,iMethodName]),iRequest,iGetResponse);

You send self to the thread but sometines TROAsyncProxy its destoryed before TROAsyncProxyThread.

Can you please check this situation?

Remobjects version 8.1.85.1143 Delphi XE6

This depends on how do you are creating proxy.
can you create a simple testcase that reproduced this case, pls?

in this case, everything should be correct:

lasync := CoAsyncService_Async.Create(...);
lasync.mymethod;

but this call may cause problems:

CoAsyncService_Async.Create(...).mymethod;

btw, you can try to use our new async proxy (*_AsyncEx) that is created in .NET style and contains begin/end methods.
The Photo Server sample demonstrates usage of new async proxy.