forked from mia/Aegisub
Originally committed to SVN as r315.
This commit is contained in:
parent
08db974ab9
commit
0c7804502b
2 changed files with 8 additions and 1 deletions
|
@ -151,8 +151,10 @@ void AegisubApp::OnFatalException() {
|
||||||
AssFile::top->Save(filename,false,false);
|
AssFile::top->Save(filename,false,false);
|
||||||
|
|
||||||
// Stack walk
|
// Stack walk
|
||||||
|
#if wxUSE_STACKWALKER == 1
|
||||||
StackWalker walker;
|
StackWalker walker;
|
||||||
walker.WalkFromException();
|
walker.WalkFromException();
|
||||||
|
#endif
|
||||||
|
|
||||||
// Inform user of crash
|
// 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);
|
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
|
// Stack walker
|
||||||
|
#if wxUSE_STACKWALKER == 1
|
||||||
void StackWalker::OnStackFrame(const wxStackFrame &frame) {
|
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());
|
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];
|
char temp[2048];
|
||||||
|
@ -185,6 +188,8 @@ StackWalker::~StackWalker() {
|
||||||
file.close();
|
file.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//////////////////
|
//////////////////
|
||||||
|
|
|
@ -85,6 +85,7 @@ public:
|
||||||
|
|
||||||
////////////////
|
////////////////
|
||||||
// Stack walker
|
// Stack walker
|
||||||
|
#if wxUSE_STACKWALKER == 1
|
||||||
class StackWalker: public wxStackWalker {
|
class StackWalker: public wxStackWalker {
|
||||||
private:
|
private:
|
||||||
std::ofstream file;
|
std::ofstream file;
|
||||||
|
@ -94,6 +95,7 @@ public:
|
||||||
~StackWalker();
|
~StackWalker();
|
||||||
void OnStackFrame(const wxStackFrame& frame);
|
void OnStackFrame(const wxStackFrame& frame);
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue