lua-users home
lua-l archive

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


>>>>> "Guenther" == Guenther Kramer <kramer.guenther@orbcomm.com> writes:

 Guenther> Hi,
 Guenther> I am trying to generate a traceback when garbage collection
 Guenther> raises an exception. This of course can happen if the '__gc'
 Guenther> metamethod raises an exception. The problem I am encountering
 Guenther> is that the message handler is ignored:

Quoth the documentation:

"(The message handler is called only for regular runtime errors. It is
not called for memory-allocation errors nor for errors while running
finalizers.)"

What you'd need to do is to wrap each __gc method in its own xpcall.

-- 
Andrew.