Title: [87911] trunk/Source/WebCore
Revision
87911
Author
[email protected]
Date
2011-06-02 08:32:57 -0700 (Thu, 02 Jun 2011)

Log Message

2011-06-02  Hans Wennborg  <[email protected]>

        Reviewed by Tony Gentilcore.

        Fix LevelDBTransaction::clearTree()
        https://bugs.webkit.org/show_bug.cgi?id=61917

        This was broken in the code I copied it from; we can't delete and walk
        the tree at the same time.

        No new functionality, no new tests.

        * platform/leveldb/LevelDBTransaction.cpp:
        (WebCore::LevelDBTransaction::clearTree):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (87910 => 87911)


--- trunk/Source/WebCore/ChangeLog	2011-06-02 14:53:41 UTC (rev 87910)
+++ trunk/Source/WebCore/ChangeLog	2011-06-02 15:32:57 UTC (rev 87911)
@@ -1,3 +1,18 @@
+2011-06-02  Hans Wennborg  <[email protected]>
+
+        Reviewed by Tony Gentilcore.
+
+        Fix LevelDBTransaction::clearTree()
+        https://bugs.webkit.org/show_bug.cgi?id=61917
+
+        This was broken in the code I copied it from; we can't delete and walk
+        the tree at the same time.
+
+        No new functionality, no new tests.
+
+        * platform/leveldb/LevelDBTransaction.cpp:
+        (WebCore::LevelDBTransaction::clearTree):
+
 2011-06-02  Andreas Kling  <[email protected]>
 
         Rubber-stamped by Simon Hausmann.

Modified: trunk/Source/WebCore/platform/leveldb/LevelDBTransaction.cpp (87910 => 87911)


--- trunk/Source/WebCore/platform/leveldb/LevelDBTransaction.cpp	2011-06-02 14:53:41 UTC (rev 87910)
+++ trunk/Source/WebCore/platform/leveldb/LevelDBTransaction.cpp	2011-06-02 15:32:57 UTC (rev 87911)
@@ -53,11 +53,16 @@
     TreeType::Iterator iterator;
     iterator.start_iter_least(m_tree);
 
+    Vector<AVLTreeNode*> nodes;
+
     while (*iterator) {
-        delete *iterator;
+        nodes.append(*iterator);
         ++iterator;
     }
     m_tree.purge();
+
+    for (size_t i = 0; i < nodes.size(); ++i)
+        delete(nodes[i]);
 }
 
 LevelDBTransaction::~LevelDBTransaction()
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to