From 5e50e890016a3f5150577bf87b32bcf803301cb7 Mon Sep 17 00:00:00 2001 From: jsolman Date: Mon, 25 Feb 2019 18:21:17 -0800 Subject: [PATCH] Wait for ActorSystem termination before returning from Dispose() of NeoSystem. (#607) --- neo/NeoSystem.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/neo/NeoSystem.cs b/neo/NeoSystem.cs index efeb8e6f3e..480c7730df 100644 --- a/neo/NeoSystem.cs +++ b/neo/NeoSystem.cs @@ -42,7 +42,9 @@ public void Dispose() { RpcServer?.Dispose(); EnsureStoped(LocalNode); + // Dispose will call ActorSystem.Terminate() ActorSystem.Dispose(); + ActorSystem.WhenTerminated.Wait(); } public void EnsureStoped(IActorRef actor)