So i have a class that handles all of the D3D parts of my program...
That class has the following members:
public:
IDXGISwapChain* pSwapChain;
DXGI_SWAP_CHAIN_DESC scd;
ID3D11Device* pDevice;
ID3D11DeviceContext* pDeviceContext;
ID3D11RenderTargetView* pBackBuffer;
now in my class deconstructor i automatically call its member function
void CleanD3D();
which has the following implementation:
void Engine::CleanD3D()
{
pSwapChain -> Release();
pBackBuffer -> Release();
pDevice -> Release();
pDeviceContext -> Release();
}
So my main function creates an object with the Engine class, and everything goes fine.
But when i try to quit the application i call the D3D function to release everything and the program breaks... i actually have no idea why and i don't think the memory is freed...
any suggestions?
First-chance exception at 0x0134B79D in Space.exe: 0xC0000005: Access violation reading location 0x005E99E8.
Unhandled exception at 0x0134B79D in Space.exe: 0xC0000005: Access violation reading location 0x005E99E8.