Sprite was freed?
Author |
Message |
Insectoid
|
Posted: Mon May 12, 2008 6:41 pm Post subject: Sprite was freed? |
|
|
I've come across this several times.
In some of my programs, I get an error saying 'sprite was freed' when I did not tell it to be freed. Is this an automatic feature to save memory or something? |
|
|
|
|
|
Sponsor Sponsor
|
|
|
riveryu
|
Posted: Wed May 14, 2008 6:44 pm Post subject: RE:Sprite was freed? |
|
|
I have never seen that before, check your program maybe u missed something. Can you show some code so that its easier to see where an error might originate?
i think Turing holds a maximum of 1000 pics, so i think its highly unlikely that u'll run out as long as u freed unused ones. |
|
|
|
|
|
Insectoid
|
Posted: Thu May 15, 2008 6:26 pm Post subject: RE:Sprite was freed? |
|
|
Well, it works if you put it in the loop, but then I guess I would need to free it during the loop to, otherwise it gets to the max in a second.
This only seams to happen in larger programs (or possibly procedures?)
Instead of posting my code, why not go over to my pacman post, which explains all my problems and has my code available for download?
PacMan! |
|
|
|
|
|
S_Grimm
|
Posted: Fri May 16, 2008 10:24 am Post subject: RE:Sprite was freed? |
|
|
procedures do funny things when you least expect them to. move your sprite in a loop, put keep the declarations of variables for the sprite outside the loop. |
|
|
|
|
|
riveryu
|
Posted: Fri May 16, 2008 4:44 pm Post subject: Re: Sprite was freed? |
|
|
Hey, insectoid your link led me a website about sails which i dont think you intended.
I searched your profile and found this one about your PacMan.
http://compsci.ca/v3/viewtopic.php?t=18054&highlight= -PacMan Blog
I tried to solve your problem but i failed, sry.
- I erased all sprite.free , the blueghost sprite was still freed
- I decreased the amount of sprites, failed |
|
|
|
|
|
Insectoid
|
Posted: Sat May 17, 2008 3:04 pm Post subject: RE:Sprite was freed? |
|
|
Oops, I was looking at boats that day, likely (I enjoy sailing/windsurfing)
Erased all Sprite.Free? Lol, I didn't have any!
Move my sprite inside the loop? what, Sprite.SetPosition? Sprite.Show? Sprite.New? Which one do I put in the loop? |
|
|
|
|
|
|
|