Mercurial > vim
comparison src/insexpand.c @ 26518:13ba00ef7687 v8.2.3788
patch 8.2.3788: lambda for option that is a function may be freed
Commit: https://github.com/vim/vim/commit/6ae8fae8696623b527c7fb22567f6a3705b2f0dd
Author: Yegappan Lakshmanan <yegappan@yahoo.com>
Date: Sun Dec 12 16:26:44 2021 +0000
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 #9330)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 12 Dec 2021 17:30:04 +0100 |
parents | 65b4109a4297 |
children | 84d56c5b7f2b |
comparison
equal
deleted
inserted
replaced
26517:7dfc4c45f698 | 26518:13ba00ef7687 |
---|---|
2339 } | 2339 } |
2340 | 2340 |
2341 return retval; | 2341 return retval; |
2342 } | 2342 } |
2343 | 2343 |
2344 /* | |
2345 * Mark the global 'completefunc' 'omnifunc' and 'thesaurusfunc' callbacks with | |
2346 * 'copyID' so that they are not garbage collected. | |
2347 */ | |
2348 int | |
2349 set_ref_in_insexpand_funcs(int copyID) | |
2350 { | |
2351 int abort = FALSE; | |
2352 | |
2353 abort = set_ref_in_callback(&cfu_cb, copyID); | |
2354 abort = abort || set_ref_in_callback(&ofu_cb, copyID); | |
2355 abort = abort || set_ref_in_callback(&tsrfu_cb, copyID); | |
2356 | |
2357 return abort; | |
2358 } | |
2344 | 2359 |
2345 /* | 2360 /* |
2346 * Get the user-defined completion function name for completion 'type' | 2361 * Get the user-defined completion function name for completion 'type' |
2347 */ | 2362 */ |
2348 static char_u * | 2363 static char_u * |