Please confirm if I have a misunderstanding of the Delphi Async interface
I was under the impression I could call ‘invoke’, wait until answer received then set the Async service to nil and everything would be done. Under memory leak testing I notice procedure TROBaseSuperChannelWorker.DoExecute;
lData: TROBinaryMemoryStream; // This is not freed in this instance, or at least not for a long time which doesn’t work in high speed processing
Whilst you are considering the below, what is the best way to ‘wait for answer received to be true’ in a non-ui multi-threaded application.
procedure( .... ) var service: ILogServerService_Async; begin service := CoLogServerService_Async.create( ... ); try service.Invoke_log_Message(....); while not service.AnswerReceived do sleep(10); //NEVER do this.... service.Retrieve_Log_Message; except end; //Service is interface, would free here automatically end);