A
Adiabat
Guest
Hi all,
I continue to have peculiar problems with surfaces. When running the code below my RAM increases at a rate of ~ 50 MB/s until eventually I get an "out of memory" error. Any advice would be appreciated.
Some notes:
1. Unless I have forgotten something this is currently the only code in my program.
2. The code is taken directly from the help manual in the entry "sprite_create_from_surface" except I have commented out the lines that draw the sprites and have changed the dimensions from 32 to 512.
3. The memory leak seems to occurs even with the original dimension of 32, although far more slowly.
4. The line which causes the memory leak is the one which executes "sprite_create_from_surface".
Draw event:
I continue to have peculiar problems with surfaces. When running the code below my RAM increases at a rate of ~ 50 MB/s until eventually I get an "out of memory" error. Any advice would be appreciated.
Some notes:
1. Unless I have forgotten something this is currently the only code in my program.
2. The code is taken directly from the help manual in the entry "sprite_create_from_surface" except I have commented out the lines that draw the sprites and have changed the dimensions from 32 to 512.
3. The memory leak seems to occurs even with the original dimension of 32, although far more slowly.
4. The line which causes the memory leak is the one which executes "sprite_create_from_surface".
Draw event:
Code:
var surf;
surf = surface_create(512, 512);
surface_set_target(surf);
draw_clear_alpha(c_black, 0);
// draw_sprite(spr_Body, 0, 0, 0);
// draw_sprite(spr_Clothes, 0, 0, 0);
// draw_sprite(spr_Hair, 0, 0, 0);
spr_custom = sprite_create_from_surface(surf, 0, 0, 512, 512, true, true, 16, 16);
surface_reset_target();
surface_free(surf);