aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-05-09 14:33:55 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-05-09 14:33:55 +0000
commit4175388afa47b921aa3f273dcae6cffaccbf3ffb (patch)
tree86d8f1a751dfda397370d9655dda384b3147b21f /src/core
parent95c2003740c4cd01fd1b02ed93b9de7227b1d0f5 (diff)
QuadTree: don't leak deferred inserts past clear()
BUG=skia: R=djsollen@google.com, mtklein@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/277713003 git-svn-id: http://skia.googlecode.com/svn/trunk@14670 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core')
-rw-r--r--src/core/SkQuadTree.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/core/SkQuadTree.cpp b/src/core/SkQuadTree.cpp
index fb02e68c5f..a11613d08b 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());
+ SkASSERT(fNodePool.allocated() == fNodePool.available());
}
int SkQuadTree::getDepth() const {