Cleanup After C++

Started by
19 comments, last by ConayR 16 years, 5 months ago
You're missing one important reason why applications should do the right cleanup. DirectX is based on COM model, which means you have one instance of object referenced by (possibly) multiple applications. To make story short: it is possible that when you call some method, the code executes somewhere in a different process. That process is doing the bookkeeping required to serve several callers (ref counting) and it is possible that it has some data allocated to handle your application. So not releasing COM interfaces may lead to memory leaks in different processes. It is also possible that GDI objects used by your application are allocated in the explorer process. Results would be the same.

This topic is closed to new replies.

Advertisement