Mercurial > vim
comparison src/channel.c @ 26217:d25c0b0aad7d v8.2.3640
patch 8.2.3640: freeze when calling term_wait() in a close callback
Commit: https://github.com/vim/vim/commit/eea32afdb83ae281a63152f7494f79ec7e45ff55
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Nov 21 14:51:13 2021 +0000
patch 8.2.3640: freeze when calling term_wait() in a close callback
Problem: Freeze when calling term_wait() in a close callback.
Solution: Set a "closing" flag to tell term_wait() to return. (closes https://github.com/vim/vim/issues/9152)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 21 Nov 2021 16:00:04 +0100 |
parents | ea0820d05257 |
children | b18f3b0f317c |
comparison
equal
deleted
inserted
replaced
26216:285b3f4de8a9 | 26217:d25c0b0aad7d |
---|---|
3154 | 3154 |
3155 if (invoke_close_cb) | 3155 if (invoke_close_cb) |
3156 { | 3156 { |
3157 ch_part_T part; | 3157 ch_part_T part; |
3158 | 3158 |
3159 #ifdef FEAT_TERMINAL | |
3160 // let the terminal know it is closing to avoid getting stuck | |
3161 term_channel_closing(channel); | |
3162 #endif | |
3159 // Invoke callbacks and flush buffers before the close callback. | 3163 // Invoke callbacks and flush buffers before the close callback. |
3160 if (channel->ch_close_cb.cb_name != NULL) | 3164 if (channel->ch_close_cb.cb_name != NULL) |
3161 ch_log(channel, | 3165 ch_log(channel, |
3162 "Invoking callbacks and flushing buffers before closing"); | 3166 "Invoking callbacks and flushing buffers before closing"); |
3163 for (part = PART_SOCK; part < PART_IN; ++part) | 3167 for (part = PART_SOCK; part < PART_IN; ++part) |