lua-users home
lua-l archive

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


remove me



Em 28/08/2010 13:35, Francesco Abbate < francesco.bbt@gmail.com > escreveu:
Hi all,

I've got a dirty problem using weak tables, I hope someone can help
me. What I'm doing is to keep a table that map windows objects to plot
objects using the windows as weak keys. In some cases I'm doing a
reverse lookup on this table to find out which window is referencing a
particular plot.

What troubles me is that in same cases the table still contain among
the key some windows that are already finalized. I was thinking that,
because the keys are weaks, they are eliminated from the table when
the GC finalizes the object. The problem is that it does not seem to
work that way and sometimes I can access an object already finalized.

Thank in advance for the help.

Best regards,
Francesco