• Hey! Guest! The 37th GMC Jam will take place between May 28th, 12:00 UTC and June 1st, 12:00 UTC. Why not join in! Click here to find out more!

Windows Surface error when checking existance

66Gramms

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!
 

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