About memory management in lua

I noticed a reference in lua can not prevent the object in c++ from deleting.So I searched for something like pool for cache. however, I found the problem caused in this thread Memory error with schedule is really serious.To my understand,code in lua may be unpredictable at runtime.

So you should know the retain/release and autorelease mechanism,this error was trigger by the careless code.

I don’t think so. call retain and release manually in lua can not solve this problem. It can only make sense for something like cache a sprite without add it to the screen.