Search code examples
c++cdirect3ddirect3d9

With D3D, do I need to call release before I exit my process?


The tutorial that i'm taking for direct3d says this:

"... Basically, if you create Direct3D, but never close it, it will just keep on running in the background of the computer until your next reboot, even after the program itself closes. Bad. Especially bad if you have a lot of resources in your game. Releasing these two interfaces let's everything off the hook and allows Windows to take back it's memory." (link)

I really don't believe what this tutorial says, that the resources will still hang about after you exit the process...

Like if my program crashes or i simply press stop while debugging.. are the resources still hanging around? And other games which use directx, i often close them by killing the process.

Will the resources be free to the operating system if i exit my process and don't call device->Release?


Solution

  • Simply put, no. That is not true. When your process terminates, all your DirectX resources will be freed and no GPU or system memory will be leaked.