diff --git a/src/main/kotlin/app/termora/HostTreeDialog.kt b/src/main/kotlin/app/termora/HostTreeDialog.kt index b7495ae..46d5be9 100644 --- a/src/main/kotlin/app/termora/HostTreeDialog.kt +++ b/src/main/kotlin/app/termora/HostTreeDialog.kt @@ -36,7 +36,7 @@ class HostTreeDialog( title = I18n.getString("termora.transport.sftp.select-host") tree.setModel(SearchableHostTreeModel(tree.model) { host -> - host.protocol == Protocol.Folder || host.protocol == Protocol.SSH + (host.protocol == Protocol.Folder || host.protocol == Protocol.SSH) && filter.invoke(host) }) tree.contextmenu = true tree.doubleClickConnection = false @@ -73,6 +73,7 @@ class HostTreeDialog( addWindowListener(object : WindowAdapter() { override fun windowClosed(e: WindowEvent) { + tree.setModel(null) Database.getDatabase().properties.putString( "HostTreeDialog.HostTreeExpansionState", TreeUtils.saveExpansionState(tree) diff --git a/src/main/kotlin/app/termora/WelcomePanel.kt b/src/main/kotlin/app/termora/WelcomePanel.kt index 63c7257..67ac711 100644 --- a/src/main/kotlin/app/termora/WelcomePanel.kt +++ b/src/main/kotlin/app/termora/WelcomePanel.kt @@ -229,6 +229,7 @@ class WelcomePanel(private val windowScope: WindowScope) : JPanel(BorderLayout() } override fun dispose() { + hostTree.setModel(null) properties.putString("WelcomeFullContent", fullContent.toString()) }