mirror of
https://github.com/neovim/neovim.git
synced 2025-10-15 14:26:07 +00:00
vim-patch:8.2.3788: lambda for option that is a function may be freed
Problem: Lambda for option that is a function may be garbage collected.
Solution: Set a reference in the funcref. (Yegappan Lakshmanan,
closes vim/vim#9330)
6ae8fae869
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
This commit is contained in:
@@ -2299,6 +2299,17 @@ int set_thesaurusfunc_option(void)
|
||||
return retval;
|
||||
}
|
||||
|
||||
/// Mark the global 'completefunc' 'omnifunc' and 'thesaurusfunc' callbacks with
|
||||
/// "copyID" so that they are not garbage collected.
|
||||
bool set_ref_in_insexpand_funcs(int copyID)
|
||||
{
|
||||
bool abort = set_ref_in_callback(&cfu_cb, copyID, NULL, NULL);
|
||||
abort = abort || set_ref_in_callback(&ofu_cb, copyID, NULL, NULL);
|
||||
abort = abort || set_ref_in_callback(&tsrfu_cb, copyID, NULL, NULL);
|
||||
|
||||
return abort;
|
||||
}
|
||||
|
||||
/// Get the user-defined completion function name for completion "type"
|
||||
static char_u *get_complete_funcname(int type)
|
||||
{
|
||||
|
Reference in New Issue
Block a user