Expr: use class IntrusivePtr

As a side effect, this fixes lots of memory leaks in
`*Expr::InitVal()` because in most implementations, the `aggr`
parameter leaks.
This commit is contained in:
Max Kellermann 2020-02-26 19:12:57 +01:00
parent 7be3641f1d
commit c3ea246237
17 changed files with 885 additions and 1206 deletions

View file

@ -6,6 +6,7 @@
#include "Expr.h"
#include "Desc.h"
#include "Val.h"
#include "IntrusivePtr.h"
#include "threading/SerialTypes.h"
const char* attr_name(attr_tag t)
@ -109,10 +110,8 @@ void Attr::DescribeReST(ODesc* d, bool shorten) const
else
{
Val* v = expr->Eval(0);
ODesc dd;
v->Describe(&dd);
Unref(v);
expr->Eval(0)->Describe(&dd);
string s = dd.Description();
for ( size_t i = 0; i < s.size(); ++i )