diff options
author | Tom Englund <[email protected]> | 2024-05-03 15:42:08 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2024-05-03 14:42:08 +0100 |
commit | d5bf15387ad3b4ee36cae7a3cd9f4a9c28790f2e (patch) | |
tree | d5c82bfa5c3c1aa2d35cdbb1ad67b3c37d17cbbb /src/debug/HyprNotificationOverlay.cpp | |
parent | 387127b12ab5df8f8f40e8da7d76f47636562cab (diff) | |
download | Hyprland-d5bf15387ad3b4ee36cae7a3cd9f4a9c28790f2e.tar.gz Hyprland-d5bf15387ad3b4ee36cae7a3cd9f4a9c28790f2e.zip |
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
Diffstat (limited to 'src/debug/HyprNotificationOverlay.cpp')
-rw-r--r-- | src/debug/HyprNotificationOverlay.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/debug/HyprNotificationOverlay.cpp b/src/debug/HyprNotificationOverlay.cpp index 2f00d978..80c80601 100644 --- a/src/debug/HyprNotificationOverlay.cpp +++ b/src/debug/HyprNotificationOverlay.cpp @@ -36,6 +36,13 @@ CHyprNotificationOverlay::CHyprNotificationOverlay() { m_szIconFontName = fonts.substr(COLON + 2, LASTCHAR - (COLON + 2)); } +CHyprNotificationOverlay::~CHyprNotificationOverlay() { + if (m_pCairo) + cairo_destroy(m_pCairo); + if (m_pCairoSurface) + cairo_surface_destroy(m_pCairoSurface); +} + void CHyprNotificationOverlay::addNotification(const std::string& text, const CColor& color, const float timeMs, const eIcons icon, const float fontSize) { const auto PNOTIF = m_dNotifications.emplace_back(std::make_unique<SNotification>()).get(); |