From 544164f63788faa585623aa024ad558611ffbe64 Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Fri, 27 Oct 2023 18:42:38 +1100 Subject: [PATCH] [host] dxgi: allow the backend to shutdown before freeing comRef globals --- host/platform/Windows/capture/DXGI/src/dxgi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/host/platform/Windows/capture/DXGI/src/dxgi.c b/host/platform/Windows/capture/DXGI/src/dxgi.c index af6ef610..a0c8ef41 100644 --- a/host/platform/Windows/capture/DXGI/src/dxgi.c +++ b/host/platform/Windows/capture/DXGI/src/dxgi.c @@ -964,6 +964,9 @@ static bool dxgi_deinit(void) if (this->dup && *this->dup) dxgi_releaseFrame(); + // this MUST run before backend->free(). + comRef_free(); + if (this->backend) { this->backend->free(); @@ -985,7 +988,6 @@ static bool dxgi_deinit(void) } this->initialized = false; - comRef_free(); return true; }