comparison src/eval.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 4e057409f1d7
children 3e54b31d50c7
comparison
equal deleted inserted replaced
8317:10a72904e595 8318:190d8084cb3a
7745 */ 7745 */
7746 int 7746 int
7747 channel_unref(channel_T *channel) 7747 channel_unref(channel_T *channel)
7748 { 7748 {
7749 if (channel != NULL && --channel->ch_refcount <= 0) 7749 if (channel != NULL && --channel->ch_refcount <= 0)
7750 { 7750 return channel_may_free(channel);
7751 channel_may_free(channel);
7752 return TRUE;
7753 }
7754 return FALSE; 7751 return FALSE;
7755 } 7752 }
7756 #endif 7753 #endif
7757 7754
7758 #if defined(FEAT_JOB) || defined(PROTO) 7755 #if defined(FEAT_JOB) || defined(PROTO)