There were too many references to the original wibar and the GC
cannot resolve them 50% of the time. As shown in test-leak, GCing
the wibar does work. Just not the way the test was strutured.
Also add some garbage collection tests. This was my original
theory about why resizing was broken, but it turned out something
in `awful.placement` leaked, not the wibar references.
The default config had tables like mywibox and mywibox[s] was the wibox
that is visible on screen s. When a screen is removed, nothing cleans up
these tables and so the screen and the wibox could not be garbage
collected. The same applies to the layoutbox, taglist etc.
This commit removes the global mywibox table and instead saves it as a
property on the screen. This way, the screen is not explicitly
referenced and when it is removed, the screen, its wibox and all of its
widgets become unreachable and can be garbage collected.
This commit also updates the docs and the tests that referenced things
(mostly the wibox) via mywibox[s] to now use s.mywibox.
Fixes: https://github.com/awesomeWM/awesome/issues/1125
Signed-off-by: Uli Schlachter <psychon@znc.in>