Index: tests/ImageCacheTest.cpp |
diff --git a/tests/ImageCacheTest.cpp b/tests/ImageCacheTest.cpp |
index 43a5e70f23b605f47eef44404f81396615b69474..92d0b519d0dc3e367161f151e7f5c3508b7dbe09 100644 |
--- a/tests/ImageCacheTest.cpp |
+++ b/tests/ImageCacheTest.cpp |
@@ -81,6 +81,7 @@ static void test_cache(skiatest::Reporter* reporter, SkScaledImageCache& cache, |
static SkDiscardableMemoryPool* gPool; |
static SkDiscardableMemory* pool_factory(size_t bytes) { |
+ SkASSERT(gPool); |
return gPool->create(bytes); |
} |
@@ -92,8 +93,9 @@ DEF_TEST(ImageCache, reporter) { |
test_cache(reporter, cache, true); |
} |
{ |
- SkDiscardableMemoryPool pool(defLimit); |
- gPool = &pool; |
+ SkAutoTUnref<SkDiscardableMemoryPool> pool( |
+ SkDiscardableMemoryPool::Create(defLimit, NULL)); |
+ gPool = pool.get(); |
SkScaledImageCache cache(pool_factory); |
test_cache(reporter, cache, true); |
} |