]> granicus.if.org Git - vim/commitdiff
patch 8.0.1286: occasional crash when using a channel v8.0.1286
authorBram Moolenaar <Bram@vim.org>
Sat, 11 Nov 2017 14:54:00 +0000 (15:54 +0100)
committerBram Moolenaar <Bram@vim.org>
Sat, 11 Nov 2017 14:54:00 +0000 (15:54 +0100)
Problem:    Occasional crash when using a channel. (Marek)
Solution:   Decrement reference count later. (closes #2315)

src/channel.c
src/version.c

index 606c66a869de4fb6c5105c60fd405b400a0ab363..8fc705058a1fc8ed493afc92d8ea7140e4fe7377 100644 (file)
@@ -2898,8 +2898,6 @@ channel_close(channel_T *channel, int invoke_close_cb)
              channel->ch_close_cb = NULL;
              channel->ch_close_partial = NULL;
 
-             --channel->ch_refcount;
-
              if (channel_need_redraw)
              {
                  channel_need_redraw = FALSE;
@@ -2910,6 +2908,8 @@ channel_close(channel_T *channel, int invoke_close_cb)
                  /* any remaining messages are useless now */
                  for (part = PART_SOCK; part < PART_IN; ++part)
                      drop_messages(channel, part);
+
+             --channel->ch_refcount;
        }
     }
 
index 8dd72301c76c696003760e326c6021cd64141e43..4368138d19ecb54f400859cee556e5facb8ff246 100644 (file)
@@ -761,6 +761,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1286,
 /**/
     1285,
 /**/