Dawn: fix for abandoned contexts.
The AbandonedContextImage test destroys the GrContextFactory (and the
DawnTestContext) before destroying the GrDawnGpu, which leaves its wgpu::Device
alive after the dawn_native::Instance which created it is freed.
The fix is to drop the ref to the Queue and Device in GrDawnGpu::disconnect().
Bug: skia:10332
Change-Id: I757d0f6e902f700d67d1d3e0d5b2d28487528b6e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/294517
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
diff --git a/src/gpu/dawn/GrDawnGpu.cpp b/src/gpu/dawn/GrDawnGpu.cpp
index f4756e7..b5f41c7 100644
--- a/src/gpu/dawn/GrDawnGpu.cpp
+++ b/src/gpu/dawn/GrDawnGpu.cpp
@@ -131,6 +131,8 @@
fDevice.Tick();
}
}
+ fQueue = nullptr;
+ fDevice = nullptr;
INHERITED::disconnect(type);
}