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 / game crash when exit

Author
Message
chan
12
Years of Service
User Offline
Joined: 14th Nov 2011
Location:
Posted: 22nd Nov 2011 09:29
title says.

whenever i click "X" or close (--'), it crashes and that causes it not to terminate. Nothing is moving only in the application.

here's the code.

i will put everything.

main


mouse


image


frames


-Excellence deals with weak people-
JTK
14
Years of Service
User Offline
Joined: 10th Feb 2010
Location:
Posted: 22nd Nov 2011 18:37
Two things I see, both in your clear() function.

First, your for loop begins with an Id of 0. Gdk resources begin with I'd 1 I think. But secondly, you should check if the resource exists before deleting it.



I'm not sure if they are causing your problems, but that's what I see at first glance...

JTK
Orac
17
Years of Service
User Offline
Joined: 16th May 2006
Location: Billingham
Posted: 22nd Nov 2011 23:07
Another point .. you are still declaring your functions as type int but not assigning the return to anything. This could be filling up the stack and causing the crash on exit. If you don't need a return value from a function then you should define it as type void



Of all the things I've lost .. I miss my marbles most of all.
chan
12
Years of Service
User Offline
Joined: 14th Nov 2011
Location:
Posted: 23rd Nov 2011 14:12
@JTK and orac
thanks for the heads up but it still crashes

i usually dont have this at my other games.

-Excellence deals with weak people-
JTK
14
Years of Service
User Offline
Joined: 10th Feb 2010
Location:
Posted: 23rd Nov 2011 17:05 Edited at: 23rd Nov 2011 17:29
Personally, the fact that I didn't see this the first time around strikes me as funny... But here's the fix.



Compare this closely to the code that you originally posted above. The changes should make the problem obvious, and since I've spent a half hour trying to track it down - strikes me as funny. Nothing against you, but the point is that I was over-thinking the issue...

Cheers!

JTK

Edit: You should get rid of one of your dbSync() calls, you don't need them both...

Login to post a reply

Server time is: 2024-04-20 05:39:42
Your offset time is: 2024-04-20 05:39:42