lua-users home
lua-l archive

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


Thanks for the resplies. I think I'll make a check on garbage collection to see if I can already load the new content in the table after clearing the references.

The transmitter cycles the function calls, so it will just do nothing during that cycle but cleaning up.

I'll text this evening.

Op 6-jul.-2015 23:15 schreef "Brigham Toskin" <brighamtoskin@gmail.com> het volgende:
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