• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Windows Surface error when checking existance

6

66Gramms

Guest
Hello!
I'm quite a beginner with surfaces and some why when i want to destroy at the end of the game i get a fatal error for the line where i check it.

Error message:
Code:
___________________________________________
############################################################################################
FATAL ERROR in
action number 1
of Other Event: Game End
for object cont_tracks:

Variable cont_tracks.surftmp(100021, -2147483648) not set before reading it.
 at gml_Object_cont_tracks_EndGameEvent_1 (line 5) - } if (surface_exists(surftmp))  //Memory leak megszüntetése
############################################################################################
Here is the content of the event (it's a game end event):
Code:
///Destroy the surface
if (surface_exists(surface_track))  //Memory leak megszüntetése
{
    surface_free(surface_track);
} if (surface_exists(surftmp))  //Memory leak megszüntetése
{
    surface_free(surftmp);
}
I have no idea how can this happen as this is just an if statement... I guess I miss something but please help me about what is that thing? Thank you in advance!
 

Simon Gust

Member
Hello!
I'm quite a beginner with surfaces and some why when i want to destroy at the end of the game i get a fatal error for the line where i check it.

Error message:
Code:
___________________________________________
############################################################################################
FATAL ERROR in
action number 1
of Other Event: Game End
for object cont_tracks:

Variable cont_tracks.surftmp(100021, -2147483648) not set before reading it.
 at gml_Object_cont_tracks_EndGameEvent_1 (line 5) - } if (surface_exists(surftmp))  //Memory leak megszüntetése
############################################################################################
Here is the content of the event (it's a game end event):
Code:
///Destroy the surface
if (surface_exists(surface_track))  //Memory leak megszüntetése
{
    surface_free(surface_track);
} if (surface_exists(surftmp))  //Memory leak megszüntetése
{
    surface_free(surftmp);
}
I have no idea how can this happen as this is just an if statement... I guess I miss something but please help me about what is that thing? Thank you in advance!
Is surftmp ever mentioned in the create event? It only has to be a declared variable for it to not crash it doesn't even have to be declared as a surface.
 
Top