Пример #1
0
void CrashHandler::crashBySIGSERV(int /*signalid*/)
{
    QString crashMsg = QApplication::tr("We're sorry, but PGE Editor has crashed. \nReason: Signal Segmentation Violation [SIGSERV]\n\n");

    if(DevConsole::isConsoleShown())
        DevConsole::closeIfPossible();

    crashMsg += QString("\n\n") + getStacktrace();

    CrashHandler* crsh = new CrashHandler(crashMsg);
    crsh->exec();

    exit(EXIT_FAILURE);
}
Пример #2
0
void CrashHandler::crashByFlood()
{
    QString crashMsg = QApplication::tr("We're sorry, but PGE Editor has crashed. \nReason: Out of memory!\n\n"
                                        "To prevent this, try closing other uneccessary programs to free up more memory.");

    if(DevConsole::isConsoleShown())
        DevConsole::closeIfPossible();

    crashMsg += QString("\n\n") + getStacktrace();

    CrashHandler* crsh = new CrashHandler(crashMsg);
    crsh->exec();

    exit(EXIT_FAILURE);
}
Пример #3
0
void
signalHandler( int sig )
{
    signal( sig, SIG_DFL );

    #ifdef WITH_GUI
        GUIProjectManager::getInstance()->emergencyBackup();
    #else
        ProjectManager::getInstance()->emergencyBackup();
    #endif

    #ifdef WITH_CRASHHANDLER_GUI
        CrashHandler* ch = new CrashHandler( sig );
        ::exit( ch->exec() );
    #else
        ::exit( 1 );
    #endif
}
Пример #4
0
void CrashHandler::crashByUnhandledException()
{
    std::exception_ptr unhandledException = std::current_exception();
    try{
        std::rethrow_exception(unhandledException);
    }
    catch(const std::exception& e)
    {
        QString crashMsg = QApplication::tr("We're sorry, but PGE Editor has crashed. \nReason: %1\n\nPlease inform our forum staff so we can try to fix this problem, Thank you\n\nForum link: engine.wohlnet.ru/forum").arg(e.what());

        if(DevConsole::isConsoleShown())
            DevConsole::closeIfPossible();

        crashMsg += QString("\n\n") + getStacktrace();

        CrashHandler* crsh = new CrashHandler(crashMsg);
        crsh->exec();
    }

    exit(EXIT_FAILURE);
}
void CrashHandler::doCrashScreenAndCleanup(QString crashMsg)
{
    //Force debug log enabling
    LogWriter::logLevel = PGE_LogLevel::Debug;
    //Append extra explanation to user how to report the crash
    crashMsg += g_messageToUser;
    //Write crash message into the log file first
    crashMsg += QString("\n\n") + getStacktrace();
    //Also save crash report into log file
    LogFatalNC(crashMsg);
    //Then, emergency save all opened files into reserve folder
    attemptCrashsave();

    //Close console box if possible
    if(DevConsole::isConsoleShown())
        DevConsole::closeIfPossible();

    MainWinConnect::pMainWin->hide();
    //And now, spawn dialog box with stack trance
    CrashHandler *crsh = new CrashHandler(crashMsg);
    crsh->exec();
    delete crsh;
}