I thought m_user pointed to the C++-side object bound to the userobject in memory? I'm trying to create a .close() function for my GUI objects, which are bound to script.
You can see the video here, actually, and maybe my problem will be more apparent:
http://www.youtube.com/watch?v=owFtSazlmjUAnyway, when I hit the "close" button in the bottom left corner of the screen, it calls the onClick function, which calls a "close" method on the container that holds all the GuiControls.
The close method is defined in C++ and should completely nullify
all references to the userObject so it can never be accessed through script again, destroy the GuiControl in memory, and then let it be collected whenever the GC chooses to kick in. I can't figure out how to nullify all the references to the userObject, though, which is causing issues with the whole concept.
Is this possible in GM? Alternatively, I figure I could leave the GuiControl's data in memory, and then when the GC collects the userObject, destroy the data at that point, but what it all boils down to is that the GuiControl must not be accessible in script at any point following the close function being called in script; must be treated as a null value.