From dc8afe6e3c330eee11dc23812a651f9d972b6812 Mon Sep 17 00:00:00 2001 From: Dmitry Rogozhkin Date: Tue, 14 Aug 2018 06:45:42 -0700 Subject: [PATCH] Decrement context refcount on Linux on Destroy Fixes #27 Without this change the following ULT tests fail on media-driver side: [ FAILED ] 2 tests, listed below: [ FAILED ] MediaDecodeDdiTest.DecodeHEVCLong [ FAILED ] MediaEncodeDdiTest.EncodeHEVC_DualPipe Signed-off-by: Dmitry Rogozhkin --- Source/GmmLib/GlobalInfo/GmmInfo.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Source/GmmLib/GlobalInfo/GmmInfo.cpp b/Source/GmmLib/GlobalInfo/GmmInfo.cpp index cdf95711..b85ac77d 100644 --- a/Source/GmmLib/GlobalInfo/GmmInfo.cpp +++ b/Source/GmmLib/GlobalInfo/GmmInfo.cpp @@ -141,6 +141,9 @@ extern "C" GMM_STATUS GMM_STDCALL GmmCreateSingletonContext(const PLATFORM Platf extern "C" void GMM_STDCALL GmmDestroySingletonContext(void) { __GMM_ASSERTPTR(pGmmGlobalContext, VOIDRETURN); +#ifndef _WIN32 + GmmLib::Context::DecrementRefCount(); +#endif // Dont delete/destruct singletonContext. This is needed so that SingletonContext is not // deleted even after UMDs are unloaded and process is still active. // Free of SingletonContext shall be handled as part of process clean up