How to check if program has cleaned up properly?

The Partridge Family were neither partridges nor a family. Discuss.
User avatar
Asimov
Posts: 814
Joined: May 19th, 2012, 11:38 pm

Re: How to check if program has cleaned up properly?

Post by Asimov » July 18th, 2013, 11:45 pm

Hi Muttley,
Ah, thats right. I used this with allegro thats why it worked :P
Well, instead using cout you could print a text with directx or even a huge red square to tell you that the destructor was called, it should work at the same way I guess.
Problem is that the destructor will only be called when I cause a shutdown of the program and before you would see anything on the screen the program would be shut down.
----> Asimov
"You know no matter how much I think I have learnt. I always end up hitting brick walls"
http://www.asimoventerprises.co.uk

User avatar
LuisR14
Posts: 1248
Joined: May 23rd, 2013, 3:52 pm
Location: USA
Contact:

Re: How to check if program has cleaned up properly?

Post by LuisR14 » July 19th, 2013, 12:11 am

also ofcourse the debugger won't break in the destructor if you're running release tho lol
and you can do some kind of temp code test in which you do something like for ex: if using chili framework in Go()

Code: Select all

if( keyb.IsKeyPressed( 'T' ) )
{
	CObj test( params );
	test.Print();
	// once code reaches '}' the destructor would be called
}
always available, always on, about ~10 years c/c++, java[script], win32/directx api, [x]html/css/php/some asp/sql experience. (all self taught)
Knows English, Spanish and Japanese.
[url=irc://irc.freenode.net/#pchili]irc://irc.freenode.net/#pchili[/url] [url=irc://luisr14.no-ip.org/#pchili]alt[/url] -- join up if ever want real-time help or to just chat :mrgreen: --

Muttley
Posts: 39
Joined: October 19th, 2012, 6:00 am

Re: How to check if program has cleaned up properly?

Post by Muttley » July 19th, 2013, 12:26 am

Asimov wrote:Hi Muttley,
Ah, thats right. I used this with allegro thats why it worked :P
Well, instead using cout you could print a text with directx or even a huge red square to tell you that the destructor was called, it should work at the same way I guess.
Problem is that the destructor will only be called when I cause a shutdown of the program and before you would see anything on the screen the program would be shut down.
i think if you put the winmain code inside a block {} might work. It will cause the code inside the block finish before winmain than you will be able to see it.

User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: How to check if program has cleaned up properly?

Post by chili » July 21st, 2013, 10:22 am

There are special programs call profilers that will attach to a running process and give you detailed information about it while running. You should look for a profiler for Win32 memory allocation / memory leaks.
Chili

User avatar
Asimov
Posts: 814
Joined: May 19th, 2012, 11:38 pm

Re: How to check if program has cleaned up properly?

Post by Asimov » July 21st, 2013, 12:08 pm

Hi chill,

Thanks I will look into that when I finished modelling my robot. It is quite complex heh heh.
----> Asimov
"You know no matter how much I think I have learnt. I always end up hitting brick walls"
http://www.asimoventerprises.co.uk

Post Reply