mirror of
https://github.com/hyprwm/Hyprland
synced 2025-02-17 03:22:31 +01:00
Compositor: fix crash on exit
This commit is contained in:
parent
878fe20409
commit
ca1c1438e3
2 changed files with 8 additions and 2 deletions
|
@ -341,8 +341,12 @@ void CCompositor::cleanup() {
|
||||||
g_pXWaylandManager->m_sWLRXWayland = nullptr;
|
g_pXWaylandManager->m_sWLRXWayland = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wl_display_destroy_clients(g_pCompositor->m_sWLDisplay);
|
||||||
|
|
||||||
wl_display_terminate(m_sWLDisplay);
|
wl_display_terminate(m_sWLDisplay);
|
||||||
|
|
||||||
|
m_sWLDisplay = nullptr;
|
||||||
|
|
||||||
g_pKeybindManager->spawn("sleep 5 && kill -9 " + std::to_string(m_iHyprlandPID)); // this is to prevent that random "freezing"
|
g_pKeybindManager->spawn("sleep 5 && kill -9 " + std::to_string(m_iHyprlandPID)); // this is to prevent that random "freezing"
|
||||||
// the PID should not be reused.
|
// the PID should not be reused.
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,13 +73,15 @@ int main(int argc, char** argv) {
|
||||||
sd_notify(0, "STOPPING=1");
|
sd_notify(0, "STOPPING=1");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
wl_display_destroy_clients(g_pCompositor->m_sWLDisplay);
|
if (g_pCompositor->m_sWLDisplay)
|
||||||
|
wl_display_destroy_clients(g_pCompositor->m_sWLDisplay);
|
||||||
|
|
||||||
// kill all clients
|
// kill all clients
|
||||||
for (auto& c : g_pCompositor->m_dProcessPIDsOnShutdown)
|
for (auto& c : g_pCompositor->m_dProcessPIDsOnShutdown)
|
||||||
kill(c, SIGKILL);
|
kill(c, SIGKILL);
|
||||||
|
|
||||||
wl_display_destroy(g_pCompositor->m_sWLDisplay);
|
if (g_pCompositor->m_sWLDisplay)
|
||||||
|
wl_display_destroy(g_pCompositor->m_sWLDisplay);
|
||||||
|
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue