[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Userdata and deleting...
- From: liam mail <liam.list@...>
- Date: Fri, 30 Oct 2009 14:38:50 +0000
2009/10/30 Kenk <firstname.lastname@example.org>
I'm just looking for a 'best-practice' scenario here... Say I've got user data all setup and Lua's happily using it. If for whatever reason that user data becomes deleted in C code (for example, a window closing, or a routine called that deletes an element in the collection that Lua happens to have a reference to somewhere else in script).... What's the best way of setting this userdata to nil in C and then telling Lua it's no longer around? In script I'd set the variable to nil... Not sure how I'd go about that from C.
It is the same principle. Say for example you have a full userdata stored as a global in Lua then: