lua-users home
lua-l archive

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


>> do
>>   local t = Timer( function() print"timeout end )
>>   t:start(1)
>> end

> No, it is the same. If you mangaged to put your userdata into
> the registry (creating a reference to it), it could not have be
> collected. If you are able to retrieve it later from the registry
> (accessing that reference), it could not have been collected.

> Are you sure only the keys are weak in your table? Are you sure the
> callback function has been stored correctly there in the first place?
> (You may try to run your code retrieves-the-userdata-from-the-registry-
> and-calls-its-callback just after setting everything in place, to see
> what happens...)

Unfortunately I am unable to spot a bug. This code is run millions and more 
times a day and does everything it should. But once in a while (a week or 
month) this error pops up. 

My next guess is that the userdata in the registry got overridden from
a third party. If it is not the original userdata, the callback retrieval will 
most probably give nil like in my case. I've added some debug code to see
if the registry was corrupted or the callback just vanished. 
I'll try to follow up on this.

- Jörg