aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorVaxry <[email protected]>2024-03-09 18:04:33 +0000
committerVaxry <[email protected]>2024-03-09 18:04:33 +0000
commit18a35b140681767e055bb78d268efafab8664f90 (patch)
tree2d7f9d6656e8904eca8da6b4a452d2f2b59f8d8d
parent7e41e5146d124aa1161a73c249d41ad60f1bb162 (diff)
downloadHyprland-18a35b140681767e055bb78d268efafab8664f90.tar.gz
Hyprland-18a35b140681767e055bb78d268efafab8664f90.zip
cursormgr: fix memory leak with cursor buffers
-rw-r--r--src/managers/CursorManager.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/managers/CursorManager.cpp b/src/managers/CursorManager.cpp
index dc62bb74..ff644010 100644
--- a/src/managers/CursorManager.cpp
+++ b/src/managers/CursorManager.cpp
@@ -127,9 +127,12 @@ void CCursorManager::setCursorFromName(const std::string& name) {
Vector2D{m_sCurrentCursorShapeData.images[0].size, m_sCurrentCursorShapeData.images[0].size},
Vector2D{m_sCurrentCursorShapeData.images[0].hotspotX, m_sCurrentCursorShapeData.images[0].hotspotY}));
- if (g_pCompositor->m_sWLRCursor)
+ if (g_pCompositor->m_sWLRCursor) {
wlr_cursor_set_buffer(g_pCompositor->m_sWLRCursor, getCursorBuffer(), m_sCurrentCursorShapeData.images[0].hotspotX, m_sCurrentCursorShapeData.images[0].hotspotY,
m_fCursorScale);
+ if (m_vCursorBuffers.size() > 1)
+ wlr_buffer_drop(&m_vCursorBuffers.front()->wlrBuffer.base);
+ }
m_bOurBufferConnected = true;