From 7c1e1b758eea922eef6c9393fa72d3bb35fbea5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Sat, 31 Jan 2009 09:56:16 +0000 Subject: [PATCH] Backport (rev 919007): Only clear QLists when they are empty. Prevents crashes. CCBUG: 182358 svn path=/branches/KDE/4.2/kdebase/workspace/; revision=919009 --- effects/coverswitch.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/effects/coverswitch.cpp b/effects/coverswitch.cpp index b7369a1990..9bba048590 100644 --- a/effects/coverswitch.cpp +++ b/effects/coverswitch.cpp @@ -201,8 +201,10 @@ void CoverSwitchEffect::paintScreen( int mask, QRegion region, ScreenPaintData& rightIndex = 0; EffectWindow* frontWindow = tempList[ index ]; - leftWindows.clear(); - rightWindows.clear(); + if( !leftWindows.isEmpty() ) + leftWindows.clear(); + if( !rightWindows.isEmpty() ) + rightWindows.clear(); bool evenWindows = ( tempList.count() % 2 == 0 ) ? true : false; int leftWindowCount = 0;