summaryrefslogtreecommitdiff
path: root/plugin.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-03-10 04:36:55 -0500
committerJeff Carr <[email protected]>2025-03-10 04:36:55 -0500
commit5fa215983b3ddd340971c62351019bcc8d1f8b8c (patch)
treea2709b606dce7931463a0724106176d78362b60e /plugin.go
parent10d4942e6c1815634ce54150d8882db122beebf2 (diff)
attempt clean plugin exits
Diffstat (limited to 'plugin.go')
-rw-r--r--plugin.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/plugin.go b/plugin.go
index 396829d..1f3bc98 100644
--- a/plugin.go
+++ b/plugin.go
@@ -333,6 +333,22 @@ func (n *Node) ListToolkits() {
}
}
+// cleanly close all toolkits
+func (n *Node) Close() {
+ Exit()
+}
+
+func Exit() {
+ log.Log(PLUG, "Closing all toolkits")
+ for _, plug := range allPlugins {
+ log.Log(PLUG, "Exit() found plugin", plug.name)
+ var a widget.Action
+ a.ActionType = widget.ToolkitClose
+ plug.pluginChan <- a
+ }
+ allPlugins = nil
+}
+
func (n *Node) CloseToolkit(name string) bool {
log.Log(PLUG, "CloseToolkit() for name =", name)
for i, plug := range allPlugins {