comparison src/channel.c @ 12818:60e1e4cfb21e v8.0.1286

patch 8.0.1286: occasional crash when using a channel commit https://github.com/vim/vim/commit/5fd8b78214a52b561780eb5ba000b1a3f5ba1d3d Author: Bram Moolenaar <Bram@vim.org> Date: Sat Nov 11 15:54:00 2017 +0100 patch 8.0.1286: occasional crash when using a channel Problem: Occasional crash when using a channel. (Marek) Solution: Decrement reference count later. (closes https://github.com/vim/vim/issues/2315)
author Christian Brabandt <cb@256bit.org>
date Sat, 11 Nov 2017 16:00:06 +0100
parents f28067b83dec
children c522585ce88d
comparison
equal deleted inserted replaced
12817:5cf3f5d55dca 12818:60e1e4cfb21e
2896 /* the callback is only called once */ 2896 /* the callback is only called once */
2897 free_callback(channel->ch_close_cb, channel->ch_close_partial); 2897 free_callback(channel->ch_close_cb, channel->ch_close_partial);
2898 channel->ch_close_cb = NULL; 2898 channel->ch_close_cb = NULL;
2899 channel->ch_close_partial = NULL; 2899 channel->ch_close_partial = NULL;
2900 2900
2901 --channel->ch_refcount;
2902
2903 if (channel_need_redraw) 2901 if (channel_need_redraw)
2904 { 2902 {
2905 channel_need_redraw = FALSE; 2903 channel_need_redraw = FALSE;
2906 redraw_after_callback(TRUE); 2904 redraw_after_callback(TRUE);
2907 } 2905 }
2908 2906
2909 if (!channel->ch_drop_never) 2907 if (!channel->ch_drop_never)
2910 /* any remaining messages are useless now */ 2908 /* any remaining messages are useless now */
2911 for (part = PART_SOCK; part < PART_IN; ++part) 2909 for (part = PART_SOCK; part < PART_IN; ++part)
2912 drop_messages(channel, part); 2910 drop_messages(channel, part);
2911
2912 --channel->ch_refcount;
2913 } 2913 }
2914 } 2914 }
2915 2915
2916 channel->ch_nb_close_cb = NULL; 2916 channel->ch_nb_close_cb = NULL;
2917 2917