mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-09 16:41:53 -07:00
Added a crash reporter
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user