- This topic has 3 replies, 2 voices, and was last updated 5 years, 6 months ago by .
Viewing 3 reply threads
Viewing 3 reply threads
- You must be logged in to reply to this topic.
hi kim
Run the following code, the ev.WaitRun method will enter an infinite loop.
procedure Tform1.Button1Click(Sender: TObject);
var
ev:IkbmMWScheduledEvent;
begin
ev:=Scheduler.Run(procedure(const AEvent:IkbmMWScheduledEvent)
begin
raise Exception.Create(‘Error Message’);
end)
.WhenException(procedure (const AEvent:IkbmMWScheduledEvent; const AException:Exception)
begin
//
end)
.Precise.Activate;
try
//
finally
ev.WaitRun; // Wait forever
end;
ShowMessage(‘Scheduled Event is finish!’); //Can’t execute here
end;
kbmMW version:kbmMW 5.11
This problem affects the TkbmMWBindings.Update method.
The TkbmMWBindings.Update method will enter an infinite loop when the UpdateNonSync method generates an exception.
Hi,
I have not specifically looked into this, but I think it could have to do with “afterrun” is not executed when an exception has been raised.
The next version will contain a statement .IgnoreExceptions which will ensure afterrun is run even if an exception is thrown. Any exception handlers will also run.
Hi,
Thanks!
5.12 fixed is OK!