mirror of
https://github.com/vim/vim.git
synced 2025-09-26 04:04:07 -04:00
patch 7.4.1322
Problem: Crash when unletting the variable that holds the channel in a callback function. (Christian Robinson) Solution: Increase the reference count while invoking the callback.
This commit is contained in:
13
src/eval.c
13
src/eval.c
@@ -7730,12 +7730,21 @@ failret:
|
||||
return OK;
|
||||
}
|
||||
|
||||
#ifdef FEAT_CHANNEL
|
||||
static void
|
||||
#if defined(FEAT_CHANNEL) || defined(PROTO)
|
||||
/*
|
||||
* Decrement the reference count on "channel" and free it when it goes down to
|
||||
* zero.
|
||||
* Returns TRUE when the channel was freed.
|
||||
*/
|
||||
int
|
||||
channel_unref(channel_T *channel)
|
||||
{
|
||||
if (channel != NULL && --channel->ch_refcount <= 0)
|
||||
{
|
||||
channel_free(channel);
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Reference in New Issue
Block a user