D3D11: DeviceChild reference counter underflow - Direct Draw Related

  • Thread starter Thread starter Dave101
  • Start date Start date
D

Dave101

Guest
Hi,

I've reached the point where I have to admit defeat. I'm currently writing a game in C++ and DX11.1. I've recently experienced an issue on shutdown when I try to release a DirectDraw RenderTarget - ComPtr<ID2D1RenderTarget> mBackGroundRT - Memory::SafeRelease(mBackGroundRT)

Error - D3D11: DeviceChild reference counter underflow. Release should not be called on objects with zero reference count.

I've looked and looked, stripped my code base down just Creating a Window, Setting up DX and nothing more.

Direct2D Setup

// Direct2D
D2D1_RENDER_TARGET_PROPERTIES mTempProps = D2D1::RenderTargetProperties(D2D1_RENDER_TARGET_TYPE_DEFAULT, D2D1::PixelFormat(DXGI_FORMAT_UNKNOWN, D2D1_ALPHA_MODE_PREMULTIPLIED));
ThrowIfFailed(mSwapChain->GetBuffer(0, IID_PPV_ARGS(&mBackGround)));// Grab BackBuffer
ThrowIfFailed(mD2DFactory->CreateDxgiSurfaceRenderTarget(mBackGround.Get(), &mTempProps, mBackGroundRT.GetAddressOf()));
// End Direct2D

I've checked ref counts and what objects remain but nothing give me an insight into what is causing this. The code worked before I implemented support for re-sizing Swap-Chain buffers but the stripped down codebase doesn't call any re-size code. Nothing was changed on the the creation of the swap chains

I don't like to reach out for help but this one has got me stumped. Any help will be greatly appreciated.

Best Regards,

Dave

Continue reading...
 
Back
Top