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

List:       kde-commits
Subject:    KDE/kdelibs/kdeui
From:       André Wöbbeking <Woebbeking () web ! de>
Date:       2005-12-06 22:56:39
Message-ID: 1133909799.804072.32714.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 486160 by woebbe:

fixed removeClient(): right now client->childClients() isn't changed by removeClient()
so the result was an endless loop (while removing the child clients).

This bug was introduced while Qt4 porting.

 M  +5 -3      kxmlguifactory.cpp  


--- trunk/KDE/kdelibs/kdeui/kxmlguifactory.cpp #486159:486160
@@ -314,9 +314,11 @@
     // remove this client from our client list
     d->m_clients.removeAll( client );
 
-    // remove child clients first
-    while (client->childClients().count())
-        removeClient(client->childClients().last());
+    // remove child clients first (create a copy of the list just in case the
+    // original list is modified directly or indirectly in removeClient())
+    const QList<KXMLGUIClient*> childClients(client->childClients());
+    foreach (KXMLGUIClient *child, childClients)
+        removeClient(child);
 
     kdDebug(1002) << "KXMLGUIFactory::removeServant, calling removeRecursive" << endl;
 
[prev in list] [next in list] [prev in thread] [next in thread] 

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