Sign in to follow this  
Haptic

C++ Hangs on close

Recommended Posts

Hey all, Bit of a minor inconvenience I'd like to be rid of: When I close my C++, the application itself closes but C++ still displays (running) in the title for about 10 seconds, in which time I cant do anything. I can however press F7, which 'stops debugging' and frees up the program. Its 10 seconds on the dot, which makes me think its some sort of timeout mechanism for whatever is holding up the system. It just started doing this one day. I originally thought it could be my Lua implementation (not killing it properly) but Ive tested without Lua and this still happens. Sorry for the vagueness, but Ive no idea what could cause this. Any similar experiences/advise much appreciated! Edit(some extra Info): I can step through the de-init code right up until 'there is no source to display', and THEN it starts the 10 second hang. [Edited by - Haptic on December 14, 2008 3:24:24 AM]

Share this post


Link to post
Share on other sites
It sound like it may be either DLL unloading, or destruction of static objects that is taking time.
What appears in the output window during that ten seconds?
When did you last run a defrag?

Share this post


Link to post
Share on other sites
Thanks for the replies guys.

the_edd: Edit: Ok I've figured out what you mean. How do I access these revisions though? Or was I supposed to manually backup revisions throughout the creation process? Sorry for my lack of understanding :).

iMalc: The output window does not change between when I begin the program and when the 10 seconds is OVER.

Start up output:

'Game.exe': Loaded 'C:\Users\Matt\Desktop\Game\Debug\Game.exe', Symbols loaded.
'Game.exe': Loaded 'C:\Windows\System32\ntdll.dll'
'Game.exe': Loaded 'C:\Windows\System32\kernel32.dll'
'Game.exe': Loaded 'C:\Windows\System32\opengl32.dll'
'Game.exe': Loaded 'C:\Windows\System32\msvcrt.dll'
'Game.exe': Loaded 'C:\Windows\System32\advapi32.dll'
'Game.exe': Loaded 'C:\Windows\System32\rpcrt4.dll'
'Game.exe': Loaded 'C:\Windows\System32\gdi32.dll'
'Game.exe': Loaded 'C:\Windows\System32\user32.dll'
'Game.exe': Loaded 'C:\Windows\System32\glu32.dll'
'Game.exe': Loaded 'C:\Windows\System32\ddraw.dll'
'Game.exe': Loaded 'C:\Windows\System32\dciman32.dll'
'Game.exe': Loaded 'C:\Windows\System32\setupapi.dll'
'Game.exe': Loaded 'C:\Windows\System32\oleaut32.dll'
'Game.exe': Loaded 'C:\Windows\System32\ole32.dll'
'Game.exe': Loaded 'C:\Windows\System32\dwmapi.dll'
'Game.exe': Loaded 'C:\Program Files\Lua\5.1\lua5.1.dll', Binary was not built with debug information.
'Game.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.1434_none_d08b6002442c891f\msvcr80.dll'
'Game.exe': Loaded 'C:\Windows\System32\winmm.dll'
'Game.exe': Loaded 'C:\Windows\System32\oleacc.dll'
'Game.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.vc90.debugcrt_1fc8b3b9a1e18e3b_9.0.21022.8_none_96748342450f6aa2\msvcp90d.dll'
'Game.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.vc90.debugcrt_1fc8b3b9a1e18e3b_9.0.21022.8_none_96748342450f6aa2\msvcr90d.dll'
'Game.exe': Loaded 'C:\Windows\System32\shimeng.dll'
'Game.exe': Loaded 'C:\Windows\System32\apphelp.dll'
'Game.exe': Loaded 'C:\Windows\AppPatch\AcLayers.dll'
'Game.exe': Loaded 'C:\Windows\System32\shell32.dll'
'Game.exe': Loaded 'C:\Windows\System32\shlwapi.dll'
'Game.exe': Loaded 'C:\Windows\System32\userenv.dll'
'Game.exe': Loaded 'C:\Windows\System32\secur32.dll'
'Game.exe': Loaded 'C:\Windows\System32\winspool.drv'
'Game.exe': Loaded 'C:\Windows\System32\mpr.dll'
'Game.exe': Loaded 'C:\Windows\System32\imm32.dll'
'Game.exe': Loaded 'C:\Windows\System32\msctf.dll'
'Game.exe': Loaded 'C:\Windows\System32\lpk.dll'
'Game.exe': Loaded 'C:\Windows\System32\usp10.dll'
'Game.exe': Loaded 'C:\Windows\System32\avgrsstx.dll'
'Game.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll'
'Game.exe': Loaded 'C:\Windows\System32\uxtheme.dll'
'Game.exe': Loaded 'C:\Windows\System32\nvoglv32.dll'
The thread 'Win32 Thread' (0xef8) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0xe48) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0xed4) has exited with code 0 (0x0).





And after the 10 seconds:

The thread 'Win32 Thread' (0xbf0) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0xf90) has exited with code 0 (0x0).
The program '[3404] Game.exe: Native' has exited with code 0 (0x0).


My computer auto-defragged a few days back, I'll do one now just to be sure. This issue just 'turned on' though. It went from instant close to 10 second close, and I dont remember what I altered just before that. I have a <1 year old computer/HDD and such so general performance shouldn't be an issue.

Edit 2: Ive made a copy of my project and am going to start hacking pieces out, see if that gives any clues.

Thanks again,

[Edited by - Haptic on December 14, 2008 7:54:21 PM]

Share this post


Link to post
Share on other sites
Ah I've solved it. Of course it boiled down to my own stupidity :p.

A typo gave me a rather huge array buried deep in my game. Obviously took a while to de-init.

Many thanks for the suggestions guys, sorry for the trouble.

Share this post


Link to post
Share on other sites
Quote:
Original post by Haptic
the_edd: Edit: Ok I've figured out what you mean. How do I access these revisions though? Or was I supposed to manually backup revisions throughout the creation process? Sorry for my lack of understanding :).

I would recommend using a version control system rather than manually back-upping your project every day. At home, I use Subversion for the repository (the place where all your projects revisions are stored) and TortoiseSVN for the 'interface' (it's integrated into the Windows context menu, and allows you to specify what files should go to the repository and when). I'd say, read up on the use of version control systems a bit and check it out - it may seem strange or clumsy at first but you'll soon see the benefits of it. :)

Share this post


Link to post
Share on other sites
Quote:
Original post by Captain P
Quote:
Original post by Haptic
the_edd: Edit: Ok I've figured out what you mean. How do I access these revisions though? Or was I supposed to manually backup revisions throughout the creation process? Sorry for my lack of understanding :).

I would recommend using a version control system rather than manually back-upping your project every day.


And post-haste! Many newer systems provide built-in features to do the kind of binary search I mentioned e.g. git and mercurial, but anything will do for starters.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this