From a6fb2688cde63da3601423f300e9ff59227e279f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Sat, 31 Jan 2009 09:49:33 +0000 Subject: [PATCH] Only clear QLists when they are empty. Prevents crashes. BUG: 182358 svn path=/trunk/KDE/kdebase/workspace/; revision=919007 --- 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;