From 04c9f6d89de700a8a820c5a13be6ed57fc98dc6d Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Mon, 17 Jun 2019 14:45:42 -0700 Subject: [PATCH] correctly check for no tabs before Destory() Signed-off-by: Jeff Carr --- window.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/window.go b/window.go index 5dc3c9c..400a3f5 100644 --- a/window.go +++ b/window.go @@ -144,7 +144,13 @@ func DeleteWindow(name string) { tab := *window.TabNumber log.Println("gui.DumpBoxes() \tWindows.TabNumber =", tab) log.Println("gui.DumpBoxes() \tSHOULD DELETE TAB", tab, "HERE") - window.UiTab.Delete(tab) + log.Println("gui.DeleteWindow() \tSHOULD DELETE TAB", tab, "HERE") + log.Println("gui.DumpBoxes() \tUiTab =", window.UiTab) + tabnum := window.UiTab.NumPages() + log.Println("gui.DumpBoxes() \tUiTab.NumPages() =", tabnum) + if (tabnum > 0) { + window.UiTab.Delete(tab) + } delete(Data.WindowMap, name) // renumber tabs here