From 48dd6251b0e54b64039e81c6308642eac7c9bda7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Sun, 12 Jul 2009 15:28:15 +0000 Subject: [PATCH] Backport r995379: Delete the old tileset whenever a new one is created. That prevents that kwin eats more and more pixmaps. svn path=/branches/KDE/4.3/kdebase/workspace/; revision=995385 --- clients/oxygen/oxygenclient.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/clients/oxygen/oxygenclient.cpp b/clients/oxygen/oxygenclient.cpp index 79726c4d1d..f1445aeaa4 100644 --- a/clients/oxygen/oxygenclient.cpp +++ b/clients/oxygen/oxygenclient.cpp @@ -88,6 +88,8 @@ void renderDot(QPainter *p, const QPointF &point, qreal diameter) OxygenClient::OxygenClient(KDecorationBridge *b, KDecorationFactory *f) : KCommonDecorationUnstable(b, f) , colorCacheInvalid_(true) + , shadowTiles_(NULL) + , glowTiles_(NULL) , helper_(*globalHelper) { qAddPostRoutine(oxkwincleanupBefore); @@ -95,6 +97,8 @@ OxygenClient::OxygenClient(KDecorationBridge *b, KDecorationFactory *f) OxygenClient::~OxygenClient() { + delete glowTiles_; + delete shadowTiles_; } QString OxygenClient::visibleName() const { @@ -561,6 +565,9 @@ TileSet *OxygenClient::shadowTiles(const QColor& color, const QColor& glow, qrea tileSet = new TileSet(shadow, size, size, 1, 1); glowTilesOption_ = opt; + if (glowTiles_) { + delete glowTiles_; + } glowTiles_ = tileSet; } else { //--------------------------------------------------------------- @@ -625,6 +632,9 @@ TileSet *OxygenClient::shadowTiles(const QColor& color, const QColor& glow, qrea tileSet = new TileSet(shadow, size, size, 1, 1); shadowTilesOption_ = opt; + if (shadowTiles_) { + delete shadowTiles_; + } shadowTiles_ = tileSet; } return tileSet;