Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Crash on exit in release build

Author
Message
Jaheco
16
Years of Service
User Offline
Joined: 30th Jun 2008
Location:
Posted: 4th Jul 2008 18:34
Whenever I run my code under release build, it seems to go perfectly. All is well, until I decide to exit the program. As soon as I try to close it in any way the thing crashes, giving me

"Unhandled exception at 0x00001b60 in Prog.exe: 0xC0000005: Access violation reading location 0x00001b60."

I looked around the forums and it seems like the thing to do would be to watch the output in debug mode to see if vc++ is averting access violations and where, but I have no such warnings.

I've also looked around all of my exiting code and I do not see any potential violations there either. All of my pointers are still in my possession before I try to delete them, so unless DarkDGK is up to some mischief (unlikely), I figure it must be some sort of issue earlier in my program that for whatever reason does not trigger until the end.

Is that possible? If not, or if it is but there is a more likely solution, I would be grateful for any imparted wisdom.
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 4th Jul 2008 20:08
Could you post some of the code? That would help.
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 4th Jul 2008 20:14
The only thing that caused me to have that kind of problem was using an OOP object that encapsulated a sprite or image when an object of the class was declared as a global. The destructor tried to call a db* function after Dark Basic has removed its support.

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
Jaheco
16
Years of Service
User Offline
Joined: 30th Jun 2008
Location:
Posted: 4th Jul 2008 20:42
Hmm, I don't have any classes that use engine functions in their destructors. Here is the code called on exit.

The game loop:


The game "destructor"


I confess, I only have one week of C++ under my belt, and I am by no means certain that this is the correct way to delete classes in arrays. I made them individually with "new," so I figured that deleting them individually was the right approach.
Zuka
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: They locked me in the insane asylum.
Posted: 4th Jul 2008 22:39
Are player and ent pointers? You can only delete pointers, as far as I know.

Jaheco
16
Years of Service
User Offline
Joined: 30th Jun 2008
Location:
Posted: 4th Jul 2008 22:48
Aye, so they are. The Player class does nothing with DarkGDK itself, whereas that is the primary use of the Entity class. However, I never tell the entities to release their sprites/particles/objects when I delete them, as I'm pretty sure the engine takes care of that for itself.

It may be of some import to mention that the player and ent arrays are both global variables declared at the top of the cpp file where I define the Single_Game_Destroy method. Might that perhaps be the source of my ills?

Login to post a reply

Server time is: 2024-09-30 01:29:49
Your offset time is: 2024-09-30 01:29:49