Skip to content

Commit

Permalink
Get rid of MainForm._onException
Browse files Browse the repository at this point in the history
  • Loading branch information
lighterowl committed Aug 3, 2024
1 parent 58dee00 commit a22f3f0
Showing 1 changed file with 0 additions and 42 deletions.
42 changes: 0 additions & 42 deletions main.pas
Original file line number Diff line number Diff line change
Expand Up @@ -809,8 +809,6 @@ TMainForm = class(TBaseForm)
{$ifdef windows}
procedure SetUpWindowsHotKey;
{$endif windows}
private
procedure _onException(Sender: TObject; E: Exception);
end;

function AppName: string;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit a22f3f0

Please sign in to comment.