0
0
mirror of https://github.com/vim/vim.git synced 2025-09-26 04:04:07 -04:00

patch 7.4.1421

Problem:    May free a channel when a callback may need to be invoked.
Solution:   Keep the channel when refcount is zero.
This commit is contained in:
Bram Moolenaar
2016-02-25 23:10:17 +01:00
parent d2227a02b0
commit c8dcbb12c5
4 changed files with 40 additions and 4 deletions

View File

@@ -7745,8 +7745,8 @@ failret:
#if defined(FEAT_CHANNEL) || defined(PROTO)
/*
* Decrement the reference count on "channel" and free it when it goes down to
* zero.
* Decrement the reference count on "channel" and maybe free it when it goes
* down to zero. Don't free it if there is a pending action.
* Returns TRUE when the channel was freed.
*/
int
@@ -7754,7 +7754,7 @@ channel_unref(channel_T *channel)
{
if (channel != NULL && --channel->ch_refcount <= 0)
{
channel_free(channel);
channel_may_free(channel);
return TRUE;
}
return FALSE;