Qt: Install crash handler on startup
This commit is contained in:
parent
122cf67bb3
commit
5aeabf028b
|
@ -1,4 +1,5 @@
|
|||
#include "common/log.h"
|
||||
#include "common/crash_handler.h"
|
||||
#include "mainwindow.h"
|
||||
#include "qthostinterface.h"
|
||||
#include "qtutils.h"
|
||||
|
@ -27,6 +28,8 @@ static bool ParseCommandLineParameters(QApplication& app, QtHostInterface* host_
|
|||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
CrashHandler::Install();
|
||||
|
||||
// Register any standard types we need elsewhere
|
||||
qRegisterMetaType<std::optional<bool>>();
|
||||
qRegisterMetaType<std::function<void()>>();
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
#include "common/file_system.h"
|
||||
#include "common/log.h"
|
||||
#include "common/string_util.h"
|
||||
#include "common/crash_handler.h"
|
||||
#include "controller_interface.h"
|
||||
#include "core/cdrom.h"
|
||||
#include "core/cheats.h"
|
||||
|
@ -64,6 +65,9 @@ bool CommonHostInterface::Initialize()
|
|||
if (!FileSystem::SetWorkingDirectory(m_user_directory.c_str()))
|
||||
Log_ErrorPrintf("Failed to set working directory to '%s'", m_user_directory.c_str());
|
||||
|
||||
// Set crash handler to dump to user directory, because of permissions.
|
||||
CrashHandler::SetWriteDirectory(m_user_directory);
|
||||
|
||||
LoadSettings();
|
||||
UpdateLogSettings(g_settings.log_level, g_settings.log_filter.empty() ? nullptr : g_settings.log_filter.c_str(),
|
||||
g_settings.log_to_console, g_settings.log_to_debug, g_settings.log_to_window,
|
||||
|
|
Loading…
Reference in New Issue