From d0d09559b82cc34a921f7d4a19e5190e43726e0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C8=98tefan=20Talpalaru?= Date: Thu, 25 Apr 2019 00:25:34 +0200 Subject: [PATCH] workaround for https://github.com/nim-lang/Nim/issues/4057 --- eth/net/nat.nim | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/eth/net/nat.nim b/eth/net/nat.nim index 0377387..63f7c1a 100644 --- a/eth/net/nat.nim +++ b/eth/net/nat.nim @@ -224,3 +224,10 @@ proc redirectPorts*(tcpPort, udpPort: Port, description: string): Option[(Port, # atexit() in disguise addQuitProc(stopNatThread) +# workaround for https://github.com/nim-lang/Nim/issues/4057 +when defined(windows): + proc handler() {.noconv.} = + setupForeignThreadGc() + quit(1) + setControlCHook(handler) +