mirror of
https://github.com/neovim/neovim.git
synced 2025-09-18 17:28:23 +00:00
vim-patch:8.1.1579: dict and list could be GC'ed while displaying error
Problem: Dict and list could be GC'ed while displaying error in a timer.
(Yasuhiro Matsumoto)
Solution: Block garbage collection when executing a timer. Add
test_garbagecollect_soon(). Add "no_wait_return" to
test_override(). (closes vim/vim#4571)
adc6714aac
This commit is contained in:
@@ -1306,7 +1306,7 @@ void tv_dict_item_remove(dict_T *const dict, dictitem_T *const item)
|
||||
dict_T *tv_dict_alloc(void)
|
||||
FUNC_ATTR_NONNULL_RET FUNC_ATTR_WARN_UNUSED_RESULT
|
||||
{
|
||||
dict_T *const d = xmalloc(sizeof(dict_T));
|
||||
dict_T *const d = xcalloc(1, sizeof(dict_T));
|
||||
|
||||
// Add the dict to the list of dicts for garbage collection.
|
||||
if (gc_first_dict != NULL) {
|
||||
|
Reference in New Issue
Block a user