diff src/channel.c @ 8318:190d8084cb3a v7.4.1451

commit https://github.com/vim/vim/commit/707659490d35e8d66e8bbdcfd93b12dc1387d86c Author: Bram Moolenaar <Bram@vim.org> Date: Sun Feb 28 19:28:59 2016 +0100 patch 7.4.1451 Problem: Vim hangs when a channel has a callback but isn't referenced. Solution: Have channel_unref() only return TRUE when the channel was actually freed.
author Christian Brabandt <cb@256bit.org>
date Sun, 28 Feb 2016 19:30:04 +0100
parents aec8f8ce8e4c
children e2021d6feeda
line wrap: on
line diff
--- a/src/channel.c
+++ b/src/channel.c
@@ -334,12 +334,17 @@ channel_still_useful(channel_T *channel)
  * Close a channel and free all its resources if there is no further action
  * possible, there is no callback to be invoked or the associated job was
  * killed.
+ * Return TRUE if the channel was freed.
  */
-    void
+    int
 channel_may_free(channel_T *channel)
 {
     if (!channel_still_useful(channel))
+    {
 	channel_free(channel);
+	return TRUE;
+    }
+    return FALSE;
 }
 
 /*