From 975bba02955d6b387d0da6942dc914256121ad40 Mon Sep 17 00:00:00 2001 From: Chris Rankin Date: Thu, 9 Feb 2017 17:14:49 +0000 Subject: [PATCH] CORPRIV-665: Protect NodeTerminalView from being destroyed twice. --- .../kotlin/net/corda/demobench/views/NodeTabView.kt | 4 ++-- .../net/corda/demobench/views/NodeTerminalView.kt | 12 ++++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/tools/demobench/src/main/kotlin/net/corda/demobench/views/NodeTabView.kt b/tools/demobench/src/main/kotlin/net/corda/demobench/views/NodeTabView.kt index a50930a2a0..44f08f93b7 100644 --- a/tools/demobench/src/main/kotlin/net/corda/demobench/views/NodeTabView.kt +++ b/tools/demobench/src/main/kotlin/net/corda/demobench/views/NodeTabView.kt @@ -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) diff --git a/tools/demobench/src/main/kotlin/net/corda/demobench/views/NodeTerminalView.kt b/tools/demobench/src/main/kotlin/net/corda/demobench/views/NodeTerminalView.kt index 04203a51d1..b511ccbecf 100644 --- a/tools/demobench/src/main/kotlin/net/corda/demobench/views/NodeTerminalView.kt +++ b/tools/demobench/src/main/kotlin/net/corda/demobench/views/NodeTerminalView.kt @@ -33,6 +33,7 @@ class NodeTerminalView : Fragment() { private val viewDatabaseButton by fxid