Web lists-archives.org

Re: [PATCH] KWin: Fix memory leak in Workspace::rootStackingOrder






2008/5/5 Kelvie Wong <kelvie@xxxxxxxx>:
This would leak memory every time compositing takes place, and really adds up
over time (I get about 500k/minute with a bunch of windows open).  KWin stays at
a lean 23MB after this patch.

This was introduced by r800581.
---
 workspace/kwin/layers.cpp |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/workspace/kwin/layers.cpp b/workspace/kwin/layers.cpp
index 1b845eb..e5e52b8 100644
--- a/workspace/kwin/layers.cpp
+++ b/workspace/kwin/layers.cpp
@@ -740,6 +740,10 @@ ToplevelList Workspace::rootStackingOrder() const
        }
    foreach( Deleted* c, deleted )
        ret.append( c );
+
+    if (windows)
+        XFree(windows);
+
    return ret;
    }

--
IIRC this is not your first code contribution, however small. Right?
In that case you might want to get an SVN account - it's not a big deal actually :)

 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<