mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-08 16:11:57 -07:00
internal: fix a few asan reported leaks on exit of hyprland (#5852)
* notifications: free cairo images on destruction asan reports a leak on exit if we dont free the image we created in the draw function. add a destructor and free images on exit. * compositor: destroy wlroots types on exit there are a few types not being destroyed on exit and causing a leak on exit in wlroots reported by asan, add those. * cursormgr: ensure we destroy cursor mgr on exit add a destructor and call wlr_xcursor_manager_destroy on the manager on destruction, leak reported by asan. * keybindmgr: free state and keymap add missing keymap_unref on creation, and add a destructor and free the state on exit. leak reported by asan. * skeyboard: add destructor and free state free the state on destruction of keyboard, reported as leak by asan
This commit is contained in:
@@ -421,8 +421,22 @@ void CCompositor::cleanup() {
|
||||
g_pWatchdog.reset();
|
||||
g_pXWaylandManager.reset();
|
||||
|
||||
wl_display_terminate(m_sWLDisplay);
|
||||
if (m_sWLRCursor)
|
||||
wlr_cursor_destroy(m_sWLRCursor);
|
||||
|
||||
if (m_sSeat.seat)
|
||||
wlr_seat_destroy(m_sSeat.seat);
|
||||
|
||||
if (m_sWLRRenderer)
|
||||
wlr_renderer_destroy(m_sWLRRenderer);
|
||||
|
||||
if (m_sWLRAllocator)
|
||||
wlr_allocator_destroy(m_sWLRAllocator);
|
||||
|
||||
if (m_sWLRBackend)
|
||||
wlr_backend_destroy(m_sWLRBackend);
|
||||
|
||||
wl_display_terminate(m_sWLDisplay);
|
||||
m_sWLDisplay = nullptr;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user