Jump to content
  • Advertisement
Sign in to follow this  
Yaz

OpenGL Memory Leak Query

This topic is 3494 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

i have a openGL game which runs fine and exits fine (when i press escape key) with: The thread 'Win32 Thread' (0xcf0) has exited with code 0 (0x0). The thread 'Win32 Thread' (0x1258) has exited with code 0 (0x0). The thread 'Win32 Thread' (0x540) has exited with code 0 (0x0). The thread 'Win32 Thread' (0x1730) has exited with code 0 (0x0). The thread 'Win32 Thread' (0x147c) has exited with code 0 (0x0). The program '[5764] OpenGL.exe: Native' has exited with code 0 (0x0). I need to know can a memory leak exist in my game even if the program exits with a code 0? if so, how can one begin to identify the leaks? Note: i'm using MS Visual Studio 2008 Pro

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by Yaz
I need to know can a memory leak exist in my game even if the program exits with a code 0?

Yes. This is trivial to determine for yourself.

int main(int, char **) {
new int;
return 0;
}


Quote:
if so, how can one begin to identify the leaks?

Memory leaks in memory allocated by the CRT, that is allocated by the default implementation of operator new, malloc() or related functions can be detected in MSVC by using the CRT heap debugging functions. Ex: you can set the CRT to check for unfreed memory at program termination by setting a CRT debug flag like so:

#include <crtdbg.h>

int main(int, char **) {
_CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
// do other stuff
}


Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!