aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorerw7 <erw7.github@gmail.com>2019-09-08 17:33:25 +0900
committererw7 <erw7.github@gmail.com>2020-02-12 16:03:54 +0900
commitd54b5997b7472f6c8a6f224801e2cd2e8ddf017b (patch)
tree8f60b4a224a943bdfe943c6395d210612212c351
parent3557757a3c410bb5c6a9066b342b4f42b75ec5ed (diff)
downloadrneovim-d54b5997b7472f6c8a6f224801e2cd2e8ddf017b.tar.gz
rneovim-d54b5997b7472f6c8a6f224801e2cd2e8ddf017b.tar.bz2
rneovim-d54b5997b7472f6c8a6f224801e2cd2e8ddf017b.zip
Fix issue where callbacks are garbage collected
Import necessary part of vim-patch:8.1.1575. https://github.com/vim/vim/commit/75a1a9415b9c207de5a29b25c0d1949c6c9c5c61
-rw-r--r--src/nvim/eval.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index df2e6bd415..ddafe1981f 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -5152,6 +5152,10 @@ bool garbage_collect(bool testing)
}
// buffer ShaDa additional data
ABORTING(set_ref_dict)(buf->additional_data, copyID);
+
+ // buffer callback functions
+ set_ref_in_callback(&buf->b_prompt_callback, copyID, NULL, NULL);
+ set_ref_in_callback(&buf->b_prompt_interrupt, copyID, NULL, NULL);
}
FOR_ALL_TAB_WINDOWS(tp, wp) {