TerryE wrote:Just remember to make everything local and even though an event has fired the reference to it is still in the handlers table, preventing GC, so doing an s:on("connection", nil) in update_factory() will dereference itself allowing GC, etc.
Moin Terry,
are you sure on this? I was under the impression that net_delete (the destructor) does free the connection ref
luaL_unref(L, LUA_REGISTRYINDEX, nud->cb_connect_ref);
on s:close and that this is even a problem because the registered disconnect handler may access freed memory.
Carsten