Therefore fixes hGetLine: illegal operation (handle is closed)
exceptions, because the handles were being closed whilst the listener
thread was still reading from them.
Fixes #66
serverAndListenerFinalizer tid = do
finally (timeout (messageTimeout config * 1^6)
(runSession' exitServer))
- (cleanupProcess server >> killThread tid)
+ -- Make sure to kill the listener first, before closing
+ -- handles etc via cleanupProcess
+ (killThread tid >> cleanupProcess server)
(result, _) <- bracket serverListenerLauncher
serverAndListenerFinalizer