lua-users home
lua-l archive

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


Hi Roberto,

I have discovered the source of the problem and it has fixed
the problem. Howvever, I do not understand it.

The 2 lines of code that were causing the problem were

     lua_createtable(L1,0,0);
     lua_setfenv(L1, funix); /* remove reference to env */

This was executed after the function in the thread had completed.
I can only presume that the author was doing this to make sure
that the environment was collected.

It would seem that this also set the environment of the function in
*all* executing threads. This does not make sense to me because
the load() function is thread specific (the function gets loaded in
each thread) and the environment gets set in each thread.

Anyway it seems to have solved the problem I was having. I just
dont understand why.

Thanks for your assistance.

David B.