Instead of going around paths to handle exceptions, you may simply not use:
function Crash(Arg: Integer): Integer; stdcall;
begin
Result := PInteger(nil)^;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
TID: Cardinal;
begin
CloseHandle(CreateThread(nil, 0, @Crash, nil, 0, TID));
end;
Crash
executed in a new thread. There are no ANY exception handlers in this thread . Any exception in such a thread will be fatal to the application.
source
share