Dx9 Release()

Started by
2 comments, last by LeGreg 16 years, 5 months ago
What happens if you forget to Release someting like a mesh or a texture? Does it affect the computer's performance? If so, the how could I fix it?
Advertisement
Causes a memory leak.

Fix: start releasing every com object.
Or better yet, use CComPtr,
Quote:Original post by Jazonxyz
What happens if you forget to Release someting like a mesh or a texture?
Does it affect the computer's performance?
If so, the how could I fix it?


If you use dynamically allocated objects, it can affect the performance of your program during its lifetime (from start to exit).

BUT, if you're asking if that should affect the performance of your computer after you exited the program, no it shouldn't (at least under winxp and vista..).
There are plenty of reason a program could early exit (one of them the user manually killing it), so the OS and drivers are programmed to ensure that even a badly written application release all allocated (graphics) resources after its process is dead.

But it's generally considered good practice to release everything after quitting the program (and it's achieved through good programming practice and testing). Some programmers won't do that though because of how their data structure is organized releasing all their stuff will take a long time after calling QUIT and in that case they think an early exit is the solution, but you shouldn't attempt that unless it has been a problem for you (last resort).

LeGreg

This topic is closed to new replies.

Advertisement