awesome/lib
Uli Schlachter ce965424c3 gears.object:weak_connect_signal: Use a weak-value table (#520)
Lua will remove objects as values from a weak table before these objects are
finalized, but as values only in the next garbage collection cycle after the
object was finalized. Up to now, gears.object uses a table with weak keys so
that :disconnect_signal() works. This means that a signal can still call methods
which were already considered garbage by the garbage collector and thus can use
userdata from the C side which was already finalized. Crashes and other bugs
result.

This commit changes the code so that the function is also a value in the weak
table. Thus, the GC will remove the entry before the object is finalized.

Special magic is needed for Lua 5.1, because there only userdata has the
behavior that we want while we have a function. We do some magic with function
environments to make this work...

Closes https://github.com/awesomeWM/awesome/pull/567.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-12-10 23:19:52 +01:00
..
awful Use integer size when creating titlebar 2015-12-10 23:13:24 +01:00
beautiful doc: fix unintentional rendering as code due to indent 2015-10-14 00:22:26 +02:00
gears gears.object:weak_connect_signal: Use a weak-value table (#520) 2015-12-10 23:19:52 +01:00
menubar feat(lib: menubar): dpi support in menubar 2015-12-10 23:18:43 +01:00
naughty naughty: Use :get_height_for_width() 2015-10-17 19:13:26 +02:00
wibox wibox.widget.systray: Also emit redraw_needed 2015-11-29 12:33:13 +01:00