X-Git-Url: http://deadsoftware.ru/gitweb?p=d2df-editor.git;a=blobdiff_plain;f=src%2Feditor%2FEditor.lpr;h=e5d615625dc332d9094a59823bba66049db33924;hp=ccbcb60f5a95cd469fd060445b2d7c62a2f202f0;hb=67cddfbb3e682ca99f9b9a2e98e87332bd5c30be;hpb=ff2c57a5e094add94022e1198f5a9e36b7a8e78a diff --git a/src/editor/Editor.lpr b/src/editor/Editor.lpr index ccbcb60..e5d6156 100644 --- a/src/editor/Editor.lpr +++ b/src/editor/Editor.lpr @@ -3,8 +3,8 @@ program Editor; {$INCLUDE ../shared/a_modes.inc} uses - Forms, Interfaces, - GL, GLExt, + Forms, Interfaces, Dialogs, + GL, GLExt, SysUtils, e_graphics in '../engine/e_graphics.pas', e_log in '../engine/e_log.pas', e_textures in '../engine/e_textures.pas', @@ -59,8 +59,23 @@ uses {$R *.res} {$ENDIF} + type + THandlerObject = class (TObject) + procedure ExceptionHandler (Sender: TObject; e: Exception); + end; + + var + H: THandlerObject; + + procedure THandlerObject.ExceptionHandler (Sender: TObject; e: Exception); + begin + e_WriteStackTrace(e.message); + MessageDlg('Unhandled exception: ' + e.message + ' (see Editor.log for more information)', mtError, [mbOK], 0); + end; + begin Application.ExceptionDialog := aedOkMessageBox; + Application.AddOnExceptionHandler(H.ExceptionHandler, True); Application.Initialize(); Application.CreateForm(TMainForm, MainForm);