Skip to main content
gamedev.net
🔒 Locked

Direct3D10 Shutdown sequence

Started by DumpAlien 0 replies 1.2k views
Original Post
DumpAlien
DumpAlien
Hello guys! I have a simple question.. I always wandering if there is some preferred shutdown sequence for Direct3D 10. there is a lot of stuff what must be released when shutting down a D3D10 App... DXGIFactory, DXGIOutput, DGXIAdapters, D3D Device, SwapChain, RenderTargetView, DepthStencilView, backBuffer, DepthStencilBuffer, VertexBuffers, IndexBuffers, Shaders, Textures etc etc etc... Should I be careful with something when I release them? Some preferred order maybe? Thanks!
jollyjeffers
jollyjeffers
I roughly follow two orders:

1. Reverse order of creation
2. Reverse order of dependency/ownership - bindable resources, shaders, devices, adaptor, factory

In general the ref counting behaviour of COM objects should stop you hurting yourself so you don't need to be too worried. Just always check that you don't have any memory leaks [wink]

That said, remember to call D3DX10UnsetAllDeviceObjects() before releasing objects or you'll get the debug runtimes screaming and shouting at you!



hth
Jack
<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ |

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.