summaryrefslogtreecommitdiff
path: root/src/region.cpp
diff options
context:
space:
mode:
authorDennis Kasprzyk <onestone@compiz-fusion.org>2008-09-25 16:22:28 +0200
committerDennis kasprzyk <onestone@compiz-fusion.org>2008-09-25 16:22:28 +0200
commitdb89bfcb67c537dadbdaf041de23beb219259b92 (patch)
treee7f1e948ec9f2c451cda4fe8f91f36a2a259ead3 /src/region.cpp
parent29eb2da61148b9c448541cd856c49d78a40d0242 (diff)
downloadunity-window-decorator-db89bfcb67c537dadbdaf041de23beb219259b92.tar.gz
unity-window-decorator-db89bfcb67c537dadbdaf041de23beb219259b92.tar.bz2
Destroy region if needed.
Diffstat (limited to 'src/region.cpp')
-rw-r--r--src/region.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/region.cpp b/src/region.cpp
index 37c664b..add6b76 100644
--- a/src/region.cpp
+++ b/src/region.cpp
@@ -69,6 +69,14 @@ CompRegion::operator= (const CompRegion &c)
priv->region = XCreateRegion ();
XUnionRegion (CompRegion ().handle (), c.priv->region, priv->region);
}
+ else
+ {
+ if (priv->region)
+ {
+ XDestroyRegion (priv->region);
+ priv->region = NULL;
+ }
+ }
return *this;
}