From a22f3f08362b1080801a1acb2bee6840ff5f53b3 Mon Sep 17 00:00:00 2001 From: Daniel Kamil Kozar Date: Sat, 3 Aug 2024 16:31:53 +0200 Subject: [PATCH] Get rid of MainForm._onException --- main.pas | 42 ------------------------------------------ 1 file changed, 42 deletions(-) diff --git a/main.pas b/main.pas index 591143c0..0188bc68 100644 --- a/main.pas +++ b/main.pas @@ -809,8 +809,6 @@ TMainForm = class(TBaseForm) {$ifdef windows} procedure SetUpWindowsHotKey; {$endif windows} -private - procedure _onException(Sender: TObject; E: Exception); end; function AppName: string; @@ -7697,46 +7695,6 @@ procedure TMainForm.OpenCurrentTorrent(OpenFolderOnly: boolean; UserDef: boolean end; end; -procedure myDumpAddr(Addr: Pointer;var f:system.text); -begin - try - WriteLn(f,BackTraceStrFunc(Addr)); - except - writeLn(f,SysBackTraceStr(Addr)); - end; -end; -procedure MyDumpExceptionBackTrace(var f:system.text); -var - FrameCount: integer; - Frames: PPointer; - FrameNumber:Integer; -begin - WriteLn(f,'Stack trace:'); - myDumpAddr(ExceptAddr,f); - FrameCount:=ExceptFrameCount; - Frames:=ExceptFrames; - for FrameNumber := 0 to FrameCount-1 do - myDumpAddr(Frames[FrameNumber],f); -end; -procedure TMainForm._onException(Sender: TObject; E: Exception); -var - f:system.text; - crashreportfilename:shortstring; -begin - crashreportfilename:='crashreport.txt'; - system.Assign(f,crashreportfilename); - if FileExists(crashreportfilename) then - system.Append(f) - else - system.Rewrite(f); - - WriteLn(f,'');WriteLn(f,'v.' + AppVersion + ' crashed((');WriteLn(f,''); - myDumpExceptionBackTrace(f); - system.close(f); - halt(0); -end; - - procedure TMainForm.FillSpeedsMenu; procedure _FillMenu(Items: TMenuItem; const Speeds: string; OnClickHandler: TNotifyEvent; CurSpeed: integer);