From 497d076903e6f5375c0456593f24adcca3db07e6 Mon Sep 17 00:00:00 2001 From: Xinhao Yuan Date: Mon, 7 Nov 2022 11:36:59 -0500 Subject: [PATCH] Skip cleanup when the tag has no screen. Also connect -> disconnect. --- layout.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/layout.lua b/layout.lua index a032310..06db4f6 100644 --- a/layout.lua +++ b/layout.lua @@ -247,12 +247,16 @@ function module.create(args_or_name, editor, default_cmd) clean_up = function (tag) local screen = tag.screen + if not screen then + -- This could happen when deleting tag. + return + end local _cd, _nt, _areas, instance, _new_placement_cb = get_instance_data(screen, tag) if tag_data[tag].regsitered then tag_data[tag].regsitered = false tag:disconnect_signal("property::layout", clean_up) - tag:connect_signal("property::selected", clean_up) + tag:disconnect_signal("property::selected", clean_up) for _, tag in pairs(instance.nested_tags) do tag:emit_signal("property::layout") end