mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:7.4.2197
Problem: All functions are freed on exit, which may hide leaks.
Solution: Only free named functions, not reference counted ones.
c257487035
This commit is contained in:
parent
e2f76d190d
commit
8cae66b5e0
@ -21781,11 +21781,15 @@ ufunc_T *find_func(char_u *name)
|
||||
void free_all_functions(void)
|
||||
{
|
||||
hashitem_T *hi;
|
||||
ufunc_T *fp;
|
||||
uint64_t skipped = 0;
|
||||
uint64_t todo;
|
||||
|
||||
/* Need to start all over every time, because func_free() may change the
|
||||
* hash table. */
|
||||
while (func_hashtab.ht_used > 0)
|
||||
for (hi = func_hashtab.ht_array;; ++hi)
|
||||
// Need to start all over every time, because func_free() may change the
|
||||
// hash table.
|
||||
while (func_hashtab.ht_used > skipped) {
|
||||
todo = func_hashtab.ht_used;
|
||||
for (hi = func_hashtab.ht_array; todo > 0; hi++) {
|
||||
if (!HASHITEM_EMPTY(hi)) {
|
||||
todo--;
|
||||
// Only free functions that are not refcounted, those are
|
||||
@ -21800,6 +21804,11 @@ void free_all_functions(void)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (skipped == 0) {
|
||||
hash_clear(&func_hashtab);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -243,7 +243,7 @@ static int included_patches[] = {
|
||||
// 2200,
|
||||
// 2199 NA
|
||||
// 2198 NA
|
||||
// 2197,
|
||||
2197,
|
||||
// 2196,
|
||||
// 2195 NA
|
||||
2194,
|
||||
|
Loading…
Reference in New Issue
Block a user