mirror of
https://github.com/TermoraDev/termora.git
synced 2026-01-16 02:12:58 +08:00
fix: 修复可能导致内存泄漏的问题
This commit is contained in:
@@ -36,7 +36,7 @@ class HostTreeDialog(
|
|||||||
title = I18n.getString("termora.transport.sftp.select-host")
|
title = I18n.getString("termora.transport.sftp.select-host")
|
||||||
|
|
||||||
tree.setModel(SearchableHostTreeModel(tree.model) { 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.contextmenu = true
|
||||||
tree.doubleClickConnection = false
|
tree.doubleClickConnection = false
|
||||||
@@ -73,6 +73,7 @@ class HostTreeDialog(
|
|||||||
|
|
||||||
addWindowListener(object : WindowAdapter() {
|
addWindowListener(object : WindowAdapter() {
|
||||||
override fun windowClosed(e: WindowEvent) {
|
override fun windowClosed(e: WindowEvent) {
|
||||||
|
tree.setModel(null)
|
||||||
Database.getDatabase().properties.putString(
|
Database.getDatabase().properties.putString(
|
||||||
"HostTreeDialog.HostTreeExpansionState",
|
"HostTreeDialog.HostTreeExpansionState",
|
||||||
TreeUtils.saveExpansionState(tree)
|
TreeUtils.saveExpansionState(tree)
|
||||||
|
|||||||
@@ -229,6 +229,7 @@ class WelcomePanel(private val windowScope: WindowScope) : JPanel(BorderLayout()
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun dispose() {
|
override fun dispose() {
|
||||||
|
hostTree.setModel(null)
|
||||||
properties.putString("WelcomeFullContent", fullContent.toString())
|
properties.putString("WelcomeFullContent", fullContent.toString())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user