Skip to content

Commit

Permalink
hyprcursor: fix buffer leak
Browse files Browse the repository at this point in the history
animated cursors are creating a new buffer for each image, ensure we
drop the buffers so it continously doesnt build up in infinity.
  • Loading branch information
gulafaran committed Aug 4, 2024
1 parent 56bd780 commit 3a095f6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/managers/CursorManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,9 @@ void CCursorManager::tickAnimatedCursor() {
Vector2D{m_sCurrentCursorShapeData.images[m_iCurrentAnimationFrame].hotspotX, m_sCurrentCursorShapeData.images[m_iCurrentAnimationFrame].hotspotY} / m_fCursorScale,
m_fCursorScale);

if (m_vCursorBuffers.size() > 1)
dropBufferRef(m_vCursorBuffers.at(0).get());

wl_event_source_timer_update(m_pAnimationTimer, m_sCurrentCursorShapeData.images[m_iCurrentAnimationFrame].delay);
}

Expand Down

0 comments on commit 3a095f6

Please sign in to comment.