eval: Fix ex_delfunction to use the uf_refcount field properly

@4b98ea1e80bf changed how refcounts are handled internally to fit into job
control semantics. Change the refcount check in `ex_delfunction` to consider
this. Close #3000
This commit is contained in:
Thiago de Arruda 2015-09-09 07:59:54 -03:00
parent 0a116c828d
commit b7dab423ef

View File

@ -19832,7 +19832,9 @@ void ex_delfunction(exarg_T *eap)
EMSG2(_("E131: Cannot delete function %s: It is in use"), eap->arg);
return;
}
if (fp->uf_refcount > 1) {
// check `uf_refcount > 2` because deleting a function should also reduce
// the reference count, and 1 is the initial refcount.
if (fp->uf_refcount > 2) {
EMSG2(_("Cannot delete function %s: It is being used internally"),
eap->arg);
return;