notification: Correctly handle `screen` set in the presets.
It was setting directly to `_private`, which both didn't work and caused a memory leak. Fix #3428
This commit is contained in:
parent
21a111d154
commit
e752943b98
|
@ -882,10 +882,18 @@ local function select_legacy_preset(n, args)
|
||||||
))
|
))
|
||||||
|
|
||||||
for k, v in pairs(n.preset) do
|
for k, v in pairs(n.preset) do
|
||||||
|
-- Don't keep a strong reference to the screen, Lua 5.1 GC wont be
|
||||||
|
-- smart enough to unwind the mess of circular weak references.
|
||||||
|
if k ~= "screen" then
|
||||||
n._private[k] = v
|
n._private[k] = v
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if n.preset.screen then
|
||||||
|
n._private.weak_screen[1] = capi.screen[n.preset.screen]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
--- Create a notification.
|
--- Create a notification.
|
||||||
--
|
--
|
||||||
-- @tparam table args The argument table containing any of the arguments below.
|
-- @tparam table args The argument table containing any of the arguments below.
|
||||||
|
|
Loading…
Reference in New Issue