summaryrefslogtreecommitdiff
path: root/src/Compositor.cpp
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2022-07-12 23:11:34 +0200
committervaxerski <43317083+vaxerski@users.noreply.github.com>2022-07-12 23:11:34 +0200
commitbf762f566f1c8c5e9c636f0d1ad4e485ad322da9 (patch)
tree667d1c3bf7a4f5f9c1e8bc0b5d7189ef2a760437 /src/Compositor.cpp
parentf9985a36b345acf3fd4f6a1ad8170a475658fb60 (diff)
Fix VRAM memory leak when releasing snapshots
Diffstat (limited to 'src/Compositor.cpp')
-rw-r--r--src/Compositor.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/Compositor.cpp b/src/Compositor.cpp
index 83fcdfcb..cdcf880c 100644
--- a/src/Compositor.cpp
+++ b/src/Compositor.cpp
@@ -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;
}
}