diff options
author | vaxerski <[email protected]> | 2023-02-19 13:45:56 +0000 |
---|---|---|
committer | vaxerski <[email protected]> | 2023-02-19 13:45:56 +0000 |
commit | 38c25bb50d76409193db2438db60369f3868edf9 (patch) | |
tree | 6450e68c394691c222209addb76d9940998a5c95 /src/Compositor.cpp | |
parent | 6548439f6ce205795bfe55fc22d30830c725e0d2 (diff) | |
download | Hyprland-38c25bb50d76409193db2438db60369f3868edf9.tar.gz Hyprland-38c25bb50d76409193db2438db60369f3868edf9.zip |
Added a crash reporter
Diffstat (limited to 'src/Compositor.cpp')
-rw-r--r-- | src/Compositor.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Compositor.cpp b/src/Compositor.cpp index 365a2c12..0b4970c2 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -2,6 +2,7 @@ #include "helpers/Splashes.hpp" #include <random> #include "debug/HyprCtl.hpp" +#include "debug/CrashReporter.hpp" #ifdef USES_SYSTEMD #include <systemd/sd-daemon.h> // for sd_notify #endif @@ -16,6 +17,11 @@ int handleCritSignal(int signo, void* data) { return 0; // everything went fine } +void handleSegv(int sig) { + CrashReporter::createAndSaveCrash(); + exit(SIGSEGV); +} + CCompositor::CCompositor() { wlr_log_init(WLR_INFO, NULL); @@ -61,6 +67,7 @@ CCompositor::CCompositor() { // register crit signal handler wl_event_loop_add_signal(m_sWLEventLoop, SIGTERM, handleCritSignal, nullptr); + signal(SIGSEGV, handleSegv); //wl_event_loop_add_signal(m_sWLEventLoop, SIGINT, handleCritSignal, nullptr); m_sWLRBackend = wlr_backend_autocreate(m_sWLDisplay, &m_sWLRSession); |