Fix mFenceEvent HANDLE leak
dawn_native::d3d12::Device::mFenceEvent is created in Initialize but is never closed. Fix is to close in the destructor if it has been previously created. Bug: dawn:215 Change-Id: Ie9e7a395fe6fe791e2581295ed12f20070671afa Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/10480 Commit-Queue: Kai Ninomiya <kainino@chromium.org> Reviewed-by: Austin Eng <enga@chromium.org> Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This commit is contained in:
parent
3f21e11e24
commit
25cc723823
|
@ -120,6 +120,10 @@ namespace dawn_native { namespace d3d12 {
|
|||
// Call Tick() again to clear them before releasing the allocator.
|
||||
mResourceAllocator->Tick(mCompletedSerial);
|
||||
|
||||
if (mFenceEvent != nullptr) {
|
||||
::CloseHandle(mFenceEvent);
|
||||
}
|
||||
|
||||
ASSERT(mUsedComObjectRefs.Empty());
|
||||
ASSERT(mPendingCommands.commandList == nullptr);
|
||||
}
|
||||
|
|
|
@ -107,7 +107,7 @@ namespace dawn_native { namespace d3d12 {
|
|||
Serial mCompletedSerial = 0;
|
||||
Serial mLastSubmittedSerial = 0;
|
||||
ComPtr<ID3D12Fence> mFence;
|
||||
HANDLE mFenceEvent;
|
||||
HANDLE mFenceEvent = nullptr;
|
||||
|
||||
ComPtr<ID3D12Device> mD3d12Device; // Device is owned by adapter and will not be outlived.
|
||||
ComPtr<ID3D12CommandQueue> mCommandQueue;
|
||||
|
|
Loading…
Reference in New Issue