patch 7.4.1536
Problem: Cannot re-use a channel for another job.
Solution: Add the "channel" option to job_start().
diff --git a/src/os_win32.c b/src/os_win32.c
index c4dc349..49fd0f7 100644
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -5138,7 +5138,14 @@
if (!use_null_for_in || !use_null_for_out || !use_null_for_err)
{
- channel = add_channel();
+ if (options->jo_set & JO_CHANNEL)
+ {
+ channel = options->jo_channel;
+ if (channel != NULL)
+ ++channel->ch_refcount;
+ }
+ else
+ channel = add_channel();
if (channel == NULL)
goto failed;
}
@@ -5188,9 +5195,6 @@
use_out_for_err || use_file_for_err || use_null_for_err
? INVALID_FD : (sock_T)efd[0]);
channel_set_job(channel, job, options);
-# ifdef FEAT_GUI
- channel_gui_register(channel);
-# endif
}
# endif
return;
@@ -5203,7 +5207,7 @@
CloseHandle(ifd[1]);
CloseHandle(ofd[1]);
CloseHandle(efd[1]);
- channel_free(channel);
+ channel_unref(channel);
# else
; /* make compiler happy */
# endif