Mercurial > vim
comparison 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 |
comparison
equal
deleted
inserted
replaced
8317:10a72904e595 | 8318:190d8084cb3a |
---|---|
332 | 332 |
333 /* | 333 /* |
334 * Close a channel and free all its resources if there is no further action | 334 * Close a channel and free all its resources if there is no further action |
335 * possible, there is no callback to be invoked or the associated job was | 335 * possible, there is no callback to be invoked or the associated job was |
336 * killed. | 336 * killed. |
337 */ | 337 * Return TRUE if the channel was freed. |
338 void | 338 */ |
339 int | |
339 channel_may_free(channel_T *channel) | 340 channel_may_free(channel_T *channel) |
340 { | 341 { |
341 if (!channel_still_useful(channel)) | 342 if (!channel_still_useful(channel)) |
343 { | |
342 channel_free(channel); | 344 channel_free(channel); |
345 return TRUE; | |
346 } | |
347 return FALSE; | |
343 } | 348 } |
344 | 349 |
345 /* | 350 /* |
346 * Close a channel and free all its resources. | 351 * Close a channel and free all its resources. |
347 */ | 352 */ |