diff --git a/core/main.cpp b/core/main.cpp index 79b2e0411..74405a320 100644 --- a/core/main.cpp +++ b/core/main.cpp @@ -151,8 +151,10 @@ void AegisubApp::OnFatalException() { AssFile::top->Save(filename,false,false); // Stack walk +#if wxUSE_STACKWALKER == 1 StackWalker walker; walker.WalkFromException(); +#endif // Inform user of crash wxMessageBox(_T("Aegisub has encountered a fatal error and will terminate now. The subtitles you were working on were saved to \"") + filename + _T("\", but they might be corrupt."), _T("Fatal error"), wxOK | wxICON_ERROR, NULL); @@ -162,6 +164,7 @@ void AegisubApp::OnFatalException() { //////////////// // Stack walker +#if wxUSE_STACKWALKER == 1 void StackWalker::OnStackFrame(const wxStackFrame &frame) { wxString dst = wxString::Format(_T("%03i - 0x%08X: "),frame.GetLevel(),frame.GetAddress()) + frame.GetName() + _T(" on ") + frame.GetFileName() + wxString::Format(_T(":%i"),frame.GetLine()); char temp[2048]; @@ -185,6 +188,8 @@ StackWalker::~StackWalker() { file.close(); } } +#endif + ////////////////// diff --git a/core/main.h b/core/main.h index ce374bb39..da9ee4f6f 100644 --- a/core/main.h +++ b/core/main.h @@ -64,7 +64,7 @@ public: static wxString fullPath; static wxString folderName; - + void GetFullPath(wxString arg); void GetFolderName(); void RegistryAssociate(); @@ -85,6 +85,7 @@ public: //////////////// // Stack walker +#if wxUSE_STACKWALKER == 1 class StackWalker: public wxStackWalker { private: std::ofstream file; @@ -94,6 +95,7 @@ public: ~StackWalker(); void OnStackFrame(const wxStackFrame& frame); }; +#endif #endif