mirror of
https://github.com/corda/corda.git
synced 2024-12-28 16:58: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) {
|
if (config != null) {
|
||||||
nodeConfigView.isVisible = false
|
nodeConfigView.isVisible = false
|
||||||
nodeTab.text = config.legalName
|
nodeTab.text = config.legalName
|
||||||
nodeTerminalView.open(config, onExit = { onTabClose(config) })
|
nodeTerminalView.open(config, onExit = { onTerminalExit(config) })
|
||||||
|
|
||||||
nodeTab.setOnSelectionChanged {
|
nodeTab.setOnSelectionChanged {
|
||||||
if (nodeTab.isSelected) {
|
if (nodeTab.isSelected) {
|
||||||
@ -196,7 +196,7 @@ class NodeTabView : Fragment() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun onTabClose(config: NodeConfig) {
|
private fun onTerminalExit(config: NodeConfig) {
|
||||||
Platform.runLater {
|
Platform.runLater {
|
||||||
nodeTab.requestClose()
|
nodeTab.requestClose()
|
||||||
nodeController.dispose(config)
|
nodeController.dispose(config)
|
||||||
|
@ -33,6 +33,7 @@ class NodeTerminalView : Fragment() {
|
|||||||
private val viewDatabaseButton by fxid<Button>()
|
private val viewDatabaseButton by fxid<Button>()
|
||||||
private val launchExplorerButton by fxid<Button>()
|
private val launchExplorerButton by fxid<Button>()
|
||||||
|
|
||||||
|
private var isClosed: Boolean = false
|
||||||
private val explorer = explorerController.explorer()
|
private val explorer = explorerController.explorer()
|
||||||
private val viewer = DBViewer()
|
private val viewer = DBViewer()
|
||||||
private var rpc: NodeRPC? = null
|
private var rpc: NodeRPC? = null
|
||||||
@ -114,10 +115,13 @@ class NodeTerminalView : Fragment() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
fun close() {
|
fun close() {
|
||||||
explorer.close()
|
if (!isClosed) {
|
||||||
viewer.close()
|
explorer.close()
|
||||||
rpc?.close()
|
viewer.close()
|
||||||
pty?.close()
|
rpc?.close()
|
||||||
|
pty?.close()
|
||||||
|
isClosed = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun refreshTerminal() {
|
fun refreshTerminal() {
|
||||||
|
Loading…
Reference in New Issue
Block a user