diff options
-rw-r--r-- | otherlibs/win32unix/channels.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/otherlibs/win32unix/channels.c b/otherlibs/win32unix/channels.c index 0347bd38a8..2749a766bd 100644 --- a/otherlibs/win32unix/channels.c +++ b/otherlibs/win32unix/channels.c @@ -50,6 +50,8 @@ CAMLprim value win_inchannel_of_filedescr(value handle) fflush(stdin); #endif chan = caml_open_descriptor_in(win_CRT_fd_of_filedescr(handle)); + chan->flags |= CHANNEL_FLAG_MANAGED_BY_GC; + /* as in caml_ml_open_descriptor_in() */ if (Descr_kind_val(handle) == KIND_SOCKET) chan->flags |= CHANNEL_FLAG_FROM_SOCKET; vchan = caml_alloc_channel(chan); @@ -64,6 +66,8 @@ CAMLprim value win_outchannel_of_filedescr(value handle) struct channel * chan; chan = caml_open_descriptor_out(win_CRT_fd_of_filedescr(handle)); + chan->flags |= CHANNEL_FLAG_MANAGED_BY_GC; + /* as in caml_ml_open_descriptor_out() */ if (Descr_kind_val(handle) == KIND_SOCKET) chan->flags |= CHANNEL_FLAG_FROM_SOCKET; vchan = caml_alloc_channel(chan); |