diff --git a/aegisub/src/main.cpp b/aegisub/src/main.cpp index a2860bfcc..f0fd63b9a 100644 --- a/aegisub/src/main.cpp +++ b/aegisub/src/main.cpp @@ -390,28 +390,14 @@ void AegisubApp::HandleEvent(wxEvtHandler *handler, wxEventFunction func, wxEven /// @param cause cause of the crash. /// StackWalker::StackWalker(wxString cause) { - - wxFileName report_dir(""); - report_dir.SetPath(StandardPaths::DecodePath("?user/reporter")); - if (!report_dir.DirExists()) report_dir.Mkdir(); - crash_text = new wxFile(StandardPaths::DecodePath("?user/crashlog.txt"), wxFile::write_append); - crash_xml = new wxFile(StandardPaths::DecodePath("?user/reporter/crash.xml"), wxFile::write); - if ((crash_text->IsOpened()) && (crash_xml->IsOpened())) { + if (crash_text->IsOpened()) { wxDateTime time = wxDateTime::Now(); crash_text->Write(wxString::Format("--- %s ------------------\n", time.FormatISOCombined())); crash_text->Write(wxString::Format("VER - %s\n", GetAegisubLongVersionString())); crash_text->Write(wxString::Format("FTL - Beginning stack dump for \"%s\":\n", cause)); - - crash_xml->Write( "\n"); - crash_xml->Write( " \n"); - crash_xml->Write(wxString::Format(" %s\n", cause)); - crash_xml->Write(wxString::Format(" \n", time.FormatISOCombined())); - crash_xml->Write(wxString::Format(" %s\n", GetAegisubLongVersionString())); - crash_xml->Write( " \n"); - crash_xml->Write( " \n"); } } @@ -419,36 +405,22 @@ StackWalker::StackWalker(wxString cause) { /// @param frame frame to parse. /// void StackWalker::OnStackFrame(const wxStackFrame &frame) { - - if ((crash_text->IsOpened()) && (crash_xml->IsOpened())) { - + if (crash_text->IsOpened()) { wxString dst = wxString::Format("%03u - %p: ", (unsigned)frame.GetLevel(),frame.GetAddress()) + frame.GetName(); if (frame.HasSourceLocation()) dst = wxString::Format("%s on %s:%u", dst, frame.GetFileName(), (unsigned)frame.GetLine()); crash_text->Write(wxString::Format("%s\n", dst)); - - crash_xml->Write(wxString::Format(" \n", (int)frame.GetLevel(), frame.GetAddress())); - crash_xml->Write(wxString::Format(" %s\n", frame.GetName())); - if (frame.HasSourceLocation()) - crash_xml->Write(wxString::Format(" %s\n", (unsigned)frame.GetLine(), frame.GetFileName())); - crash_xml->Write(wxString::Format(" \n", frame.GetModule())); - crash_xml->Write( " \n"); } } /// @brief Called at the end of walking the stack. StackWalker::~StackWalker() { - if ((crash_text->IsOpened()) && (crash_xml->IsOpened())) { + if (crash_text->IsOpened()) { crash_text->Write("End of stack dump.\n"); crash_text->Write("----------------------------------------\n\n"); crash_text->Close(); - - crash_xml->Write(" \n"); - crash_xml->Write("\n"); - - crash_xml->Close(); } } #endif diff --git a/aegisub/src/main.h b/aegisub/src/main.h index d2c14ba99..c523d477b 100644 --- a/aegisub/src/main.h +++ b/aegisub/src/main.h @@ -104,7 +104,6 @@ wxDECLARE_APP(AegisubApp); #if wxUSE_STACKWALKER == 1 class StackWalker: public wxStackWalker { wxFile *crash_text; // FP to the crash text file. - wxFile *crash_xml; // FP to the crash xml file. public: StackWalker(wxString cause);