mirror of
https://github.com/zeek/zeek.git
synced 2025-10-16 21:48:21 +00:00
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:
parent
7be3641f1d
commit
c3ea246237
17 changed files with 885 additions and 1206 deletions
|
@ -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 )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue