# Device Disposing Memory leak issue

I have a memory issue after disposing all my D3D objects and lastly disposing the device. I want to free all memory and, depending on user interaction, creating a new device, but removing all memory footprint of the old device.

I traced down some Disposing issues I had to only have this left, right at the line at disposing the device:

I get this by calling:

mDevice.QueryInterface<DeviceDebug>().ReportLiveDeviceObjects(ReportingLevel.Summary)


I understand that that the DeviceDebug interface I receive to get this debug information increases the Refcount of the ID3D11Device by +1. So it should be 2 references left.

Now I wonder if I need to track down this last reference (the 2nd) in order to get the device fully released after I call .Dispose(). Or if this is a internal refernece that is handled for me.

The issue is, that I don't know how to check for remainding objects after the device disposing. I get no warnings about active objects in output anymore, them I fixed already.

My memory grows linearly by about ~15MB each creation and destruction of my window (not closing the application, just the part that needs a device).

Any help appreciated!

The other, more reliable, way is to make a call to ID3D11DeviceContext::ClearState before disposing. This will also release all outstanding references, and is more suitable for doing a full shutdown of video, where the more nuclear option is exactly what you want.