Dawn: fix Device leak in DawnTestContext.

The C WGPUDevice returned by CreateDevice needs an Acquire call to
ensure it's correctly refcounted.

Bug: skia:10291

Change-Id: If5d917165b5846bea1472f24aa12db2db7f3a9e6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292958
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
This commit is contained in:
Stephen White 2020-05-29 13:58:39 -04:00 committed by Skia Commit-Bot
parent 59aa4b7187
commit f40cef851c

View File

@ -88,7 +88,7 @@ public:
std::vector<dawn_native::Adapter> adapters = instance.GetAdapters();
for (dawn_native::Adapter adapter : adapters) {
if (adapter.GetBackendType() == type) {
return adapter.CreateDevice();
return wgpu::Device::Acquire(adapter.CreateDevice());
}
}
return nullptr;