[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdelibs/kdeui/kernel
From:       Luboš Luňák <l.lunak () kde ! org>
Date:       2010-07-29 14:33:40
Message-ID: 20100729143340.84D8CAC782 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1156691 by lunakl:

Make sure the iterator goes out of scope before possibly deleting its list.
BUG: 243540
CCMAIL: Matthew Woehlke <mw_triad@users.sourceforge.net>



 M  +3 -2      kapplication.cpp  


--- trunk/KDE/kdelibs/kdeui/kernel/kapplication.cpp #1156690:1156691
@@ -271,8 +271,9 @@
         return;
     // removeAll doesn't work, creating QWeakPointer to something that's about to be deleted aborts
     // x11Filter->removeAll( const_cast< QWidget* >( filter ));
-    QMutableListIterator< QWeakPointer< QWidget > > it( *x11Filter );
-    while( it.hasNext()) {
+    for( QMutableListIterator< QWeakPointer< QWidget > > it( *x11Filter );
+         it.hasNext();
+         ) {
         QWidget* w = it.next().data();
         if( w == filter || w == NULL )
             it.remove();
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic