Version: June 2010 with .NET 4.0
The implementation of OpenSharedResource in Device10.cpp is not releasing the
temporary handle from ID3D10Device::OpenSharedResource. This remains as an
outstanding reference and prevents the shared resource from being released. I
resolved the issue in my local copy of the source as follows:
generic<typename T> where T : ComObject
T Device::OpenSharedResource(System::IntPtr handle)
{
ID3D10Resource *resultPointer;
HRESULT hr = InternalPointer->OpenSharedResource( handle.ToPointer(), __uuidof(ID3D10Resource), (void**)(&resultPointer) );
if( RECORD_D3D10( hr ).IsFailure )
return T();
MethodInfo^ method = T::typeid->GetMethod( "FromPointer", BindingFlags::Public | BindingFlags::Static );
T result = safe_cast<T>( method->Invoke( nullptr, gcnew array<Object^> { IntPtr( resultPointer ) } ) );
resultPointer->Release();
return result;
}
I believe this problem is in the Direct3D 11 implementation as well.
Original issue reported on code.google.com by eFea...@gmail.com on 4 Nov 2010 at 6:03
Original issue reported on code.google.com by
eFea...@gmail.com
on 4 Nov 2010 at 6:03