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

List:       kde-commits
Subject:    kdebase/libkonq
From:       André Wöbbeking <Woebbeking () web ! de>
Date:       2005-01-28 21:42:06
Message-ID: 20050128214206.03B041CF5F () office ! kde ! org
[Download RAW message or body]

CVS commit by woebbe: 

--leaks in addToHistory(), patch by dfaure


  M +8 -5      konq_historymgr.cc   1.52


--- kdebase/libkonq/konq_historymgr.cc  #1.51:1.52
@@ -299,7 +299,7 @@ void KonqHistoryManager::addToHistory( b
     entry.lastVisited = entry.firstVisited;
 
-    if ( !pending ) { // remove from pending if available.
+    // always remove from pending if available, otherwise the else branch leaks
+    // if the map already contains an entry for this key.
         QMapIterator<QString,KonqHistoryEntry*> it = m_pending.find( u );
-
         if ( it != m_pending.end() ) {
             delete it.data();
@@ -305,5 +305,8 @@ void KonqHistoryManager::addToHistory( b
             delete it.data();
             m_pending.remove( it );
+    }
 
+    if ( !pending ) {
+        if ( it != m_pending.end() ) {
             // we make a pending entry official, so we just have to update
             // and not increment the counter. No need to care about


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

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