Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Destruct an image object

edited March 2012 in Questions Posts: 65

A very basic question I guess. Is there any way to destruct an image object. What I wanna do is destroy an image object when I press a button. I have managed to do it by reinitializing the same object ( keeping the object name same) but I don't know if that's the best way to do.

Tagged:

Comments

  • Posts: 159

    As far as I'm aware, you should just be able to set the variable that holds the image to 'nil'. Once an object becomes 'unreachable', it'll be cleaned up by Lua's garbage collector.

    I may be wrong, though!

  • SimeonSimeon Admin Mod
    Posts: 5,718

    No, that's correct. Just set the image to nil, make sure it's not being referenced from anywhere, and it will get cleaned up.

  • That's pretty easy. Thanks a lot Frosty and Simeon.

Sign In or Register to comment.