shithub: choc

Download patch

ref: 1680a64e775713478597248e5ecdf90aa1ef33ee
parent: b63dc8941ddde045b9d8b498d618452ea0846f42
author: Alex Mayfield <alexmax2742@gmail.com>
date: Tue Feb 21 17:29:25 EST 2017

Close client copies of inherited handles

This ensures that if the server dies, attempts to write to the server
pipe will return an error, instead of writing into oblivion and an
eventual deadlock when the pipe buffer fills up.

--- a/src/i_midipipe.c
+++ b/src/i_midipipe.c
@@ -440,6 +440,12 @@
         goto fail;
     }
 
+    // Since the server has these handles, we don't need them anymore.
+    CloseHandle(midi_process_in_reader);
+    midi_process_in_reader = NULL;
+    CloseHandle(midi_process_out_writer);
+    midi_process_out_writer = NULL;
+
     midi_server_initialized = true;
     return true;