From 3c36106589399112d7291134d7eab1152b0fda4e Mon Sep 17 00:00:00 2001 From: foreman Date: Wed, 27 May 2015 18:00:49 -0400 Subject: [PATCH] P4 to Git Change 1155068 by jatang@jatang-opencl-hsa-stg1 on 2015/05/27 17:48:24 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit EPR #419347 - Fix a d3d9 memory leak. According to https://msdn.microsoft.com/en-us/library/windows/desktop/bb174386(v=vs.85).aspx: “Calling IDirect3DDevice9::GetDirect3D will increase the internal reference count on the IDirect3D9 interface. Failure to call IUnknown::Release when finished using this IDirect3D9 interface results in a memory leak.”. Although p3d9devEx->Release() has the same effect as p3d9dev->Release(), for clarification we better use p3d9dev->Release() instead. Affected files ... ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gslbe/src/rt/GSLDeviceD3D9.cpp#13 edit [ROCm/clr commit: 6d913bfc2381f867cb6bff800e3418927ad98ce2] --- .../rocclr/runtime/device/gpu/gslbe/src/rt/GSLDeviceD3D9.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/clr/rocclr/runtime/device/gpu/gslbe/src/rt/GSLDeviceD3D9.cpp b/projects/clr/rocclr/runtime/device/gpu/gslbe/src/rt/GSLDeviceD3D9.cpp index c7a94d841d..d96197bf69 100644 --- a/projects/clr/rocclr/runtime/device/gpu/gslbe/src/rt/GSLDeviceD3D9.cpp +++ b/projects/clr/rocclr/runtime/device/gpu/gslbe/src/rt/GSLDeviceD3D9.cpp @@ -34,7 +34,7 @@ CALGSLDevice::associateD3D9Device(void* d3d9Device) IDirect3D9Ex* p3d9devEx = static_cast(p3d9dev); p3d9devEx->GetAdapterLUID(pCaps.AdapterOrdinal, &d3d9deviceLuid); - p3d9devEx->Release(); + p3d9dev->Release(); // match the adapter if (m_adp->getMVPUinfo(&calDevAdapterLuid, &calDevChainBitMask))