• 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!

Memory Leak Problem(?) with Surfaces

G

Gre_Lor12

Guest
Hey guys eh.. I do not know what to say much... I will late on update this with a code snippet.

So pretty much I'm using surfaces for a pause menu, by creating a surface; drawing all the instances then deactivating them so then that the surface can display the draw function and I can then hence pause the game.

Memory does jump up a little which is understandable, but when freeing and clearing the surface (AKA. When unpausing) it then goes up again instead of going down.

I tested the surface code out on an empty room (excluding one object) and it still did the same (did not increase by the same margin though).

I do not know if its a deactivation/activation problem with objects inc. surface creation but I thought I would ask to see what you all think.

Code will be placed later on (Currently at college doing C++ so I do not have free time)


Thank you
Gre_Lor12~
 

NazGhuL

NazTaiL
A common error is to create the surface mutiple time on the step event.
ie:

Step event:
Code:
my_surf = surface_create(100, 100);
Will definitely leads to apocalypse...
 
G

Gre_Lor12

Guest
Nah its defo created in create event only. What I will do is recreate a post later on to show code (as I can now show the code as I'm home lol)
 
Top