awesome/lib/gears
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
..
cache.lua doc: fix unintentional rendering as code due to indent 2015-10-14 00:22:26 +02:00
color.lua doc: fix unintentional rendering as code due to indent 2015-10-14 00:22:26 +02:00
debug.lua Remove gears.debug.assert 2015-09-16 15:01:26 +02:00
init.lua Add gears.matrix for working with cairo matrices 2015-08-12 10:38:22 +02:00
matrix.lua Merge pull request #454 from psychon/remove_gears.debug.assert 2015-09-21 21:16:36 +02:00
object.lua gears.object:weak_connect_signal: Use a weak-value table (#520) 2015-12-10 23:19:52 +01:00
sort.lua Remove the *.in from all files. 2015-06-19 22:33:32 +02:00
surface.lua doc(lib: gears: surface): more verbose docstring 2015-09-07 20:29:57 +02:00
timer.lua Add some documentation to gears.timer 2015-11-01 17:08:20 +01:00
wallpaper.lua Set the wallpaper more intelligently 2015-10-26 23:06:32 +01:00