mirror of
https://github.com/vim/vim.git
synced 2025-10-23 08:44:20 -04:00
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 #4571)
This commit is contained in:
@@ -28,7 +28,7 @@ dict_alloc(void)
|
||||
{
|
||||
dict_T *d;
|
||||
|
||||
d = ALLOC_ONE(dict_T);
|
||||
d = ALLOC_CLEAR_ONE(dict_T);
|
||||
if (d != NULL)
|
||||
{
|
||||
/* Add the dict to the list of dicts for garbage collection. */
|
||||
@@ -811,7 +811,7 @@ dict_get_tv(char_u **arg, typval_T *rettv, int evaluate)
|
||||
{
|
||||
semsg(_("E723: Missing end of Dictionary '}': %s"), *arg);
|
||||
failret:
|
||||
if (evaluate)
|
||||
if (d != NULL)
|
||||
dict_free(d);
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user