IntrusivePtr: replace the "add_ref" parameter with tag structs

Using a runtime parameter is obscure and error-prone.  Avoiding
error-prone code and getting reference counting right is the whole
point of this class.
This commit is contained in:
Max Kellermann 2020-02-19 05:48:02 +01:00
parent 7c0863dccf
commit 31b3a56740
7 changed files with 41 additions and 15 deletions

View file

@ -1984,7 +1984,7 @@ void TableVal::CallChangeFunc(const Val* index, Val* old_value, OnChangeType tpe
try
{
IntrusivePtr<Val> thefunc{change_func->Eval(nullptr), false};
IntrusivePtr<Val> thefunc{AdoptRef{}, change_func->Eval(nullptr)};
if ( ! thefunc )
{