lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Sun, Jul 5, 2015 at 12:35 PM, Guido ter Horst <g.terhorst@tabbasoum.com> wrote:
The idea of the program is to use loadfile to load the functions as entries in the table currentPage. what I don't understand is that when I empty 'currentPage' by assigning NIL, and then loading another set of functions into the table 'currentPage', how is it possible that when I do that several times the program will crash?

If you are severely memory constrained on the actual device, it's possible you're running out of heap space because the garbage collector hasn't had a chance to clean up everything yet. If high responsiveness and performance isn't a big concern, depending on the version of Lua you might be able to force a full collection cycle by executing the collectgarbage() function twice in a row immediately after setting your references nil.
--
Brigham Toskin