Index: tests/ResourceCacheTest.cpp |
diff --git a/tests/ResourceCacheTest.cpp b/tests/ResourceCacheTest.cpp |
index 65b7b7ca2de630613aedd57873427d470ffa7562..a4acab86a19a968fa97a229602420cfcfec0301a 100644 |
--- a/tests/ResourceCacheTest.cpp |
+++ b/tests/ResourceCacheTest.cpp |
@@ -851,7 +851,8 @@ static void test_duplicate_unique_key(skiatest::Reporter* reporter) { |
make_unique_key<0>(&key2, 0); |
SkAutoTUnref<TestResource> d(SkNEW_ARGS(TestResource, (context->getGpu()))); |
int foo = 4132; |
- key2.setCustomData(SkData::NewWithCopy(&foo, sizeof(foo))); |
+ SkAutoTUnref<SkData> data(SkData::NewWithCopy(&foo, sizeof(foo))); |
+ key2.setCustomData(data.get()); |
d->resourcePriv().setUniqueKey(key2); |
} |
@@ -1240,7 +1241,8 @@ static void test_large_resource_count(skiatest::Reporter* reporter) { |
static void test_custom_data(skiatest::Reporter* reporter) { |
GrUniqueKey key1, key2; |
int foo = 4132; |
- key1.setCustomData(SkData::NewWithCopy(&foo, sizeof(foo))); |
+ SkAutoTUnref<SkData> data(SkData::NewWithCopy(&foo, sizeof(foo))); |
+ key1.setCustomData(data.get()); |
REPORTER_ASSERT(reporter, *(int*) key1.getCustomData()->data() == 4132); |
REPORTER_ASSERT(reporter, key2.getCustomData() == nullptr); |