Archived

This topic is now archived and is closed to further replies.

openAL and error on PostQuitMessage

This topic is 5166 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

ok, so i''ve got a really odd bug that''s proving very difficult to debug. basically in my game, if a sound is played at some point during the game (using openAL) then the program crashes during the PostQuitMessage(0) call when i close my game window. the error is: The instruction at "0x77f92373" referenced memory at "0x00000010". the memory could not be "written". this is generally an "oops" i tried to call delete on an invalid pointer....but i generally find that in my own functions not in the PostQuitMessage(0) function... now, this only happens when i run the executable outside of the debugger. inside the debugger things are fine (hence hard to debug). I''m compiled in release mode with VC.NET. Now other than the crash on the PostQuitMessage nothing else is wrong in the game. I can "play" forever and play as many sounds as i want over and over again if i choose. Since it doesn''t crash in the debugger, i''m guessing that it may be a memory initialization error, but i''ve checked the relevant sound initialization classes and nothing seems to be forgotten in the class constructors. though it''s difficult to truly tell without being able to step through with my debugger. i''ve debugged with println''s and nothing is erroneously getting deleted. does anyone have any general idea what an application error on PostQuitMessage(0) tends to mean? am i overrunning an array somewhere? -me

Share this post


Link to post
Share on other sites
thanks for the reply but the error doesn''t seem to have to do with WM_QUIT handling. at least not as far as i can tell. by the time my game is calling PostQuitMessage, it''s already shutting down and any further WM_QUIT messages are processed but there''s no effect in the game, i.e. not calling a NULL pointer or anything.

another bit of information is that it actually does throw an error in the debugger now...maybe it did before and i just didn''t notice? (odd how things change in a couple days of not coding). anyway, the error is specifically being thrown on the following call in the file crt0.c which i guess is a file included from one of my LIBs:


if ( !managedapp )
exit(mainret);


does that spawn and new ideas?

thanks

-me

Share this post


Link to post
Share on other sites
When you quit your application, you also trigger your deconstructors. It is very likely that you are deleting something again in your deconstructor.

I also get errors upon restarting my com after running an OpenAL application. It will say something about Windows just recovered from a serious error. Perhaps im not releasing the OpenAL context properly.

Mystique Legacy : Rise of the Forgotten World

Share this post


Link to post
Share on other sites
well, the thing is that the way my app is written i''ve already gone through all of my deconstructors and i''m just sitting at the end of main waiting to exit. maybe i''m not shutting down openAL properly...i''ll have to just look at all my openAL code. i hate it when debugging sucks, usually it''s so nice and easy

-me

Share this post


Link to post
Share on other sites
aha!

you were after all correct in that it had to do with deconstructors. i forgot that i have a singelton class that handles my data loading and it''s not deconstructed until the very end. the short is that i was calling alutExit() long before i was attempting to delete my sound buffers. my app is happy now. yay

-me

Share this post


Link to post
Share on other sites