Mercurial > vim
comparison src/userfunc.c @ 17151:ebe9aab81898 v8.1.1575
patch 8.1.1575: callbacks may be garbage collected
commit https://github.com/vim/vim/commit/75a1a9415b9c207de5a29b25c0d1949c6c9c5c61
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Jun 20 03:45:36 2019 +0200
patch 8.1.1575: callbacks may be garbage collected
Problem: Callbacks may be garbage collected.
Solution: Set reference in callbacks. (Ozaki Kiichi, closes https://github.com/vim/vim/issues/4564)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 20 Jun 2019 04:00:07 +0200 |
parents | d244a9be99db |
children | 1d30eb64a7a2 |
comparison
equal
deleted
inserted
replaced
17150:96373bb9c0eb | 17151:ebe9aab81898 |
---|---|
4030 { | 4030 { |
4031 int abort = FALSE; | 4031 int abort = FALSE; |
4032 funccall_T *fc; | 4032 funccall_T *fc; |
4033 funccal_entry_T *entry; | 4033 funccal_entry_T *entry; |
4034 | 4034 |
4035 for (fc = current_funccal; fc != NULL; fc = fc->caller) | 4035 for (fc = current_funccal; !abort && fc != NULL; fc = fc->caller) |
4036 abort = abort || set_ref_in_funccal(fc, copyID); | 4036 abort = abort || set_ref_in_funccal(fc, copyID); |
4037 | 4037 |
4038 // Also go through the funccal_stack. | 4038 // Also go through the funccal_stack. |
4039 for (entry = funccal_stack; entry != NULL; entry = entry->next) | 4039 for (entry = funccal_stack; !abort && entry != NULL; entry = entry->next) |
4040 for (fc = entry->top_funccal; fc != NULL; fc = fc->caller) | 4040 for (fc = entry->top_funccal; !abort && fc != NULL; fc = fc->caller) |
4041 abort = abort || set_ref_in_funccal(fc, copyID); | 4041 abort = abort || set_ref_in_funccal(fc, copyID); |
4042 | 4042 |
4043 return abort; | 4043 return abort; |
4044 } | 4044 } |
4045 | 4045 |