April 19, 2024, 12:28:13 PM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Sprites Loading and freeing question

Started by pistol350, June 08, 2008, 04:14:26 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

pistol350

hi all!

I am working on a project in which i use many sprites.
Let's say for instance that i have to load 20 sprites but for some simple reasons the 20th sprite does not load,
in which case the Loadsprite() command returns an error.
I think that before closing my screen and ending my application, I HAVE TO free all resources loaded previously;
including the first 19 sprites as not doing so WILL / MAY cause (memory leaking) problems.
Am i right ?
Regards,

Peter B.

LarryMc

From the Help pages for FREESPRITE:

QuoteAll sprites must be freed before the screen is called or memory loss will occur.

Larry
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

pistol350

Thank you Larry!

I think that you understood my point.
I've seen this "omission" so many times that i really wondered what was the proper way of doing things.
Regards,

Peter B.