Hi, I'm using a FireDAC TFDEventAlerter to be noticed of certain events happening in the database, it works fine but sometimes when I close my application (which causes the event alerter to free itself) the application freezes. I'm using Delphi 10.2 Tokyo
We've tracked the source of the infinite loop to this mehod:
unit FireDAC.Phys.ADS.pas
procedure TFDPhysADSEventAlerter.InternalAbortJob;
begin
if FWaitThread nil then
begin
FWaitThread.Terminate;
InternalSignal(C_WakeUpEvent, Null);
FWaitCommand.AbortJob(True);
while FWaitThread nil do
Sleep(1);
end;
end;
It seems the condition FWaitThread nil is never satisfied. As I said before, this problem happens randomly, I programmed a loop to try and reproduce the problem more systematically by creating and freeing an EventAlerter many times in a row in a simple project and was able to reproduce the freeze a few times when running it for hundreds of iterations. However, it seems that the problem is more frequent when the event alerter is being freed when closing the application. This is a big problem for me because I can't deliver an appllication that randomly freezes when closed, forcing the user to stop the process with the task manager.
I found another post in which the poster had a similar problem, the proposed solution was to make sure to Unregister the event alerter before closing the DB connection but for me, it didnt seem to change anything.
Thanks in advance,
Raphael.