Having DirectX Memory Leaks?

You shouldn’t. Really. Realize that there is a concept called “smart pointers“. These act just like normal pointers, except that they take into consideration the forgetfulness of humans–they make sure you don’t end up leaking something.

Now, if you didn’t know that smart pointers existed, you have a problem. A big one–you don’t know your language. It is very unfortunate that the vast majority of people choose to start with a very complex language like C++, when it only hinders their learning and development. If you’re still at an early stage, new to programming, don’t start with C++. Learn a simpler, more elegant high-level language–e.g., C#.

If you do insist on taking the C++ route, spend a couple of days reading about COM, and then check out Smart COM Pointers. Also keep in mind that there exists an excellent collecton of libraries known as boost, and that it does have smart pointers.

Good luck.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: