Closed Twinklebear closed 11 years ago
Having a good resource management system i think will make it possible to easily setup the way the Image, AnimatedImage and Text Lua libraries will be handled. Also, it should be possible to give Lua a shared_ptr since it doesn't use it internally at all, and only uses it when calling into the C library
This doesn't look like it'll be needed for now, maybe in the future as an optimization?
I'll be closing this, by leveraging use of overloading the gc metamethod and proper shared_ptr usage we can have Lua's garbage collector take care of the memory. Even C++ side memory in the case of Image and such where Lua has a shared_ptr and in gc it just calls the shared_ptr destructor.
Should some kind of resource manager be implemented? Would enable managing of resources in some way haha.
Perhaps track if a resource is no longer needed and free it? Or enable re-loading of resources to allow for immediately seeing changes?