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)
|
void free_all_functions(void)
|
||||||
{
|
{
|
||||||
hashitem_T *hi;
|
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
|
// Need to start all over every time, because func_free() may change the
|
||||||
* hash table. */
|
// hash table.
|
||||||
while (func_hashtab.ht_used > 0)
|
while (func_hashtab.ht_used > skipped) {
|
||||||
for (hi = func_hashtab.ht_array;; ++hi)
|
todo = func_hashtab.ht_used;
|
||||||
|
for (hi = func_hashtab.ht_array; todo > 0; hi++) {
|
||||||
if (!HASHITEM_EMPTY(hi)) {
|
if (!HASHITEM_EMPTY(hi)) {
|
||||||
todo--;
|
todo--;
|
||||||
// Only free functions that are not refcounted, those are
|
// Only free functions that are not refcounted, those are
|
||||||
@ -21799,6 +21803,11 @@ void free_all_functions(void)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (skipped == 0) {
|
||||||
|
hash_clear(&func_hashtab);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -243,7 +243,7 @@ static int included_patches[] = {
|
|||||||
// 2200,
|
// 2200,
|
||||||
// 2199 NA
|
// 2199 NA
|
||||||
// 2198 NA
|
// 2198 NA
|
||||||
// 2197,
|
2197,
|
||||||
// 2196,
|
// 2196,
|
||||||
// 2195 NA
|
// 2195 NA
|
||||||
2194,
|
2194,
|
||||||
|
Loading…
Reference in New Issue
Block a user