mirror of
https://github.com/corda/corda.git
synced 2024-12-28 00:38:55 +00:00
CORPRIV-665: Protect NodeTerminalView from being destroyed twice.
This commit is contained in:
parent
ccfbfde830
commit
975bba0295
@ -185,7 +185,7 @@ class NodeTabView : Fragment() {
|
||||
if (config != null) {
|
||||
nodeConfigView.isVisible = false
|
||||
nodeTab.text = config.legalName
|
||||
nodeTerminalView.open(config, onExit = { onTabClose(config) })
|
||||
nodeTerminalView.open(config, onExit = { onTerminalExit(config) })
|
||||
|
||||
nodeTab.setOnSelectionChanged {
|
||||
if (nodeTab.isSelected) {
|
||||
@ -196,7 +196,7 @@ class NodeTabView : Fragment() {
|
||||
}
|
||||
}
|
||||
|
||||
private fun onTabClose(config: NodeConfig) {
|
||||
private fun onTerminalExit(config: NodeConfig) {
|
||||
Platform.runLater {
|
||||
nodeTab.requestClose()
|
||||
nodeController.dispose(config)
|
||||
|
@ -33,6 +33,7 @@ class NodeTerminalView : Fragment() {
|
||||
private val viewDatabaseButton by fxid<Button>()
|
||||
private val launchExplorerButton by fxid<Button>()
|
||||
|
||||
private var isClosed: Boolean = false
|
||||
private val explorer = explorerController.explorer()
|
||||
private val viewer = DBViewer()
|
||||
private var rpc: NodeRPC? = null
|
||||
@ -114,10 +115,13 @@ class NodeTerminalView : Fragment() {
|
||||
})
|
||||
|
||||
fun close() {
|
||||
explorer.close()
|
||||
viewer.close()
|
||||
rpc?.close()
|
||||
pty?.close()
|
||||
if (!isClosed) {
|
||||
explorer.close()
|
||||
viewer.close()
|
||||
rpc?.close()
|
||||
pty?.close()
|
||||
isClosed = true
|
||||
}
|
||||
}
|
||||
|
||||
fun refreshTerminal() {
|
||||
|
Loading…
Reference in New Issue
Block a user