summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoronestone <onestone>2007-01-23 21:26:41 +0000
committeronestone <onestone>2007-01-23 21:26:41 +0000
commit92953bc7036563973336995e3e61cd30174440b0 (patch)
treea98b19785c0e8c941966746e4e030a71c59deb8e
parent9b9c712222f681d53c94e0c182a28cad46b22943 (diff)
downloadaquamarine-92953bc7036563973336995e3e61cd30174440b0.tar.gz
aquamarine-92953bc7036563973336995e3e61cd30174440b0.tar.bz2
aquamarine: fixed memory leak. closes #929
-rw-r--r--src/aquamarine.cpp5
-rw-r--r--src/window.cpp15
2 files changed, 13 insertions, 7 deletions
diff --git a/src/aquamarine.cpp b/src/aquamarine.cpp
index 8ee8485..0ec9fd7 100644
--- a/src/aquamarine.cpp
+++ b/src/aquamarine.cpp
@@ -91,7 +91,7 @@ main (int argc, char **argv)
Atom actual;
int result, format;
unsigned long n, left;
- unsigned char * data;
+ unsigned char * data = NULL;
result = XGetWindowProperty (dpy, wm, wm_name,
0L, 2L, FALSE, utf8_string, &actual, &format,
@@ -107,6 +107,9 @@ main (int argc, char **argv)
}
}
+ if (data)
+ XFree(data);
+
if (!wmRunning)
{
XSelectInput(dpy, wm, StructureNotifyMask);
diff --git a/src/window.cpp b/src/window.cpp
index 405269e..aaa5d9f 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -155,6 +155,9 @@ Aquamarine::Window::~Window (void)
if (mPicture)
XRenderFreePicture (qt_xdisplay (), mPicture);
+ if (mPixmap)
+ XFreePixmap (qt_xdisplay (), mPixmap);
+
if (mTexturePicture)
XRenderFreePicture (qt_xdisplay (), mTexturePicture);
@@ -1202,18 +1205,18 @@ Aquamarine::Window::resizeDecoration (bool force)
w = mGeometry.width () + mBorder.left + mBorder.right;
h = mGeometry.height () + mBorder.top + mBorder.bottom;
- if (mPixmap)
- {
- XFreePixmap (qt_xdisplay (), mPixmap);
- mPixmap = None;
- }
-
if (mPicture)
{
XRenderFreePicture (qt_xdisplay (), mPicture);
mPicture = 0;
}
+ if (mPixmap)
+ {
+ XFreePixmap (qt_xdisplay (), mPixmap);
+ mPixmap = None;
+ }
+
setGeometry (QRect (mGeometry.x () + ROOT_OFF_X - mBorder.left,
mGeometry.y () + ROOT_OFF_Y - mBorder.top,
w, h));