From 9a25ee011d231e82957c6cf79ff98c954c7b3a8c Mon Sep 17 00:00:00 2001 From: Mason Larobina Date: Mon, 16 Aug 2010 15:32:21 +0800 Subject: [PATCH] You need to destroy widgets without their own window first Labels don't draw their own window so you if you destroy a labels parent then the label will autodestruct leaving you with a widget that will blow up if you attempt to use it in any way. --- rc.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rc.lua b/rc.lua index dd13dc0..276d9c3 100755 --- a/rc.lua +++ b/rc.lua @@ -1029,9 +1029,9 @@ window_helpers = { destroy_tab_label = function (w, t) if not t then t = table.remove(w.tbar.titles) end - for _, wi in pairs(t) do - wi:destroy() - end + -- Destroy widgets without their own windows first (I.e. labels) + for _, wi in ipairs{ t.label, t.sep} do wi:destroy() end + for _, wi in ipairs{ t.ebox, t.layout} do wi:destroy() end end, update_tab_labels = function (w, current) -- 2.11.4.GIT