mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-07 07:31:53 -07:00
Fix VRAM memory leak when releasing snapshots
This commit is contained in:
@@ -852,9 +852,12 @@ void CCompositor::moveWindowToTop(CWindow* pWindow) {
|
||||
}
|
||||
}
|
||||
|
||||
void CCompositor::cleanupFadingOut() {
|
||||
void CCompositor::cleanupFadingOut(const int& monid) {
|
||||
for (auto& w : m_vWindowsFadingOut) {
|
||||
|
||||
if (w->m_iMonitorID != (long unsigned int)monid)
|
||||
continue;
|
||||
|
||||
bool valid = windowExists(w);
|
||||
|
||||
if (!valid || !w->m_bFadingOut || w->m_fAlpha.fl() == 0.f) {
|
||||
@@ -867,11 +870,16 @@ void CCompositor::cleanupFadingOut() {
|
||||
m_vWindowsFadingOut.erase(std::remove(m_vWindowsFadingOut.begin(), m_vWindowsFadingOut.end(), w));
|
||||
|
||||
Debug::log(LOG, "Cleanup: destroyed a window");
|
||||
|
||||
glFlush(); // to free mem NOW.
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
for (auto& ls : m_vSurfacesFadingOut) {
|
||||
if (ls->monitorID != monid)
|
||||
continue;
|
||||
|
||||
if (ls->fadingOut && ls->readyToDelete && !ls->alpha.isBeingAnimated()) {
|
||||
for (auto& m : m_vMonitors) {
|
||||
for (auto& lsl : m->m_aLayerSurfaceLists) {
|
||||
@@ -887,6 +895,7 @@ void CCompositor::cleanupFadingOut() {
|
||||
|
||||
Debug::log(LOG, "Cleanup: destroyed a layersurface");
|
||||
|
||||
glFlush(); // to free mem NOW.
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user