Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(134)

Unified Diff: src/core/SkQuadTree.cpp

Issue 277713003: QuadTree: don't leak deferred inserts past clear() (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkQuadTree.cpp
diff --git a/src/core/SkQuadTree.cpp b/src/core/SkQuadTree.cpp
index fb02e68c5f265f9f3d025e6b01b072934a7ad9d5..a11613d08b0260e1a65808f5a0373e6a41a59a00 100644
--- a/src/core/SkQuadTree.cpp
+++ b/src/core/SkQuadTree.cpp
@@ -46,8 +46,7 @@ static U8CPU child_intersect(const SkIRect& query, const SkIPoint& split) {
return intersect;
}
-SkQuadTree::SkQuadTree(const SkIRect& bounds)
- : fRoot(NULL) {
+SkQuadTree::SkQuadTree(const SkIRect& bounds) : fRoot(NULL) {
SkASSERT((bounds.width() * bounds.height()) > 0);
fRootBounds = bounds;
}
@@ -178,11 +177,14 @@ void SkQuadTree::search(const SkIRect& query, SkTDArray<void*>* results) {
}
void SkQuadTree::clear() {
+ this->flushDeferredInserts();
if (NULL != fRoot) {
this->clear(fRoot);
fNodePool.release(fRoot);
fRoot = NULL;
}
+ SkASSERT(fEntryPool.allocated() == fEntryPool.available());
djsollen 2014/05/09 14:23:08 should we add this here as well. SkASSERT(0 == fD
+ SkASSERT(fNodePool.allocated() == fNodePool.available());
}
int SkQuadTree::getDepth() const {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698