Fix leak of GrContextThreadSafeProxy in deferred_texture_image_data
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2069443004
Review-Url: https://codereview.chromium.org/2069443004
diff --git a/gm/deferredtextureimagedata.cpp b/gm/deferredtextureimagedata.cpp
index 951e8db..3cb1f24 100644
--- a/gm/deferredtextureimagedata.cpp
+++ b/gm/deferredtextureimagedata.cpp
@@ -27,7 +27,8 @@
std::vector<uint8_t> memory;
memory.resize(deferredSize);
- image->getDeferredTextureImageData(*context->threadSafeProxy(), params, 1, memory.data());
+ SkAutoTUnref<GrContextThreadSafeProxy> proxy(context->threadSafeProxy());
+ image->getDeferredTextureImageData(*proxy, params, 1, memory.data());
sk_sp<SkImage> uploadedImage =
SkImage::MakeFromDeferredTextureImageData(context, memory.data(), SkBudgeted::kNo);
canvas->drawImage(uploadedImage, x, y);