nimsuggest: fix tcp socket leak for epc backend (#12384) [backport]

Same as e9fa4c9b9c, but for the epc
backend which is used by emacs and vscode plugin.

Since the EPC backend only deal with one connection per nimsuggest
instance, only one socket is leaked, thus not as servere as with the tcp
backend.

(cherry picked from commit edb24b7ce0)
This commit is contained in:
alaviss
2019-10-08 12:14:18 +00:00
committed by narimiran
parent 4ae143ca60
commit f7c150766a

View File

@@ -353,7 +353,7 @@ proc replEpc(x: ThreadParams) {.thread.} =
echo port
stdout.flushFile()
var client = newSocket()
var client: Socket
# Wait for connection
accept(server, client)
while true: