From 768fba21b0de5f5e95bcda777970a0ac65f6fbab Mon Sep 17 00:00:00 2001 From: Sarah Gerweck Date: Sat, 4 Jun 2016 00:40:43 -0700 Subject: [PATCH] Make sure to unset the singleton instance on close --- src/main/scala/org/gerweck/scalafx/util/SingletonStage.scala | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/scala/org/gerweck/scalafx/util/SingletonStage.scala b/src/main/scala/org/gerweck/scalafx/util/SingletonStage.scala index a7e57b1..b8f112d 100644 --- a/src/main/scala/org/gerweck/scalafx/util/SingletonStage.scala +++ b/src/main/scala/org/gerweck/scalafx/util/SingletonStage.scala @@ -31,5 +31,10 @@ abstract class SingletonStage { protected trait ParentStage extends Stage { require(singletonStage.isEmpty, s"Cannot have two ${name} stages") logger.debug(s"Creating singleton ${name} stage") + + override def close() = { + singletonStage = None + super.close() + } } }