Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


#Actualmarius1930

Posted 31 March 2013 - 05:34 PM

#include <crtdbg.h>
 
First line of your main:
_CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
 
That should give you the allocation ID.
 
To set a breakpoint on the allocation ID either set a breakpoint on {,,msvcr100d.dll}_crtBreakAlloc   (the dll name here will change depending on your visual studio/etc)
The alternative is to call _CrtSetBreakAlloc(n); in your code.
 
 
If you want to go all the way and get file:line numbers on the leak, try:
#define new new( _NORMAL_BLOCK, __FILE__, __LINE__) 

 

 

 

Good luck! smile.png
(And if you happen to not be using MSVC, the leaks is the least of your problems)

 

Edit: Hint hint hint: Notice how your deconstructor is not virtual. Look it up! ;)


#1marius1930

Posted 31 March 2013 - 05:31 PM

#include <crtdbg.h>
 
First line of your main:
_CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
 
That should give you the allocation ID.
 
To set a breakpoint on the allocation ID either set a breakpoint on {,,msvcr100d.dll}_crtBreakAlloc   (the dll name here will change depending on your visual studio/etc)
The alternative is to call _CrtSetBreakAlloc(n); in your code.
 
 
If you want to go all the way and get file:line numbers on the leak, try:
#define new new( _NORMAL_BLOCK, __FILE__, __LINE__) 

 

 

 

Good luck! smile.png
(And if you happen to not be using MSVC, the leaks is the least of your problems)


PARTNERS