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) +