mirror of
https://github.com/zeek/zeek.git
synced 2025-10-06 16:48:19 +00:00
Scope: pop_scope() returns IntrusivePtr<>
Make sure unused scopes are freed to fix memory leaks. The comment inside pop_scope() is now obsolete and I deleted it, because this commit implements the real solution. Note that this requires us to add a reference to the push_existing_scope() call in dbg_eval_expr(), because it never owned the reference.
This commit is contained in:
parent
8ea1d89529
commit
875bfc09a2
5 changed files with 13 additions and 9 deletions
|
@ -20,6 +20,7 @@ using namespace std;
|
|||
#include "Stmt.h"
|
||||
#include "Frame.h"
|
||||
#include "Func.h"
|
||||
#include "IntrusivePtr.h"
|
||||
#include "Scope.h"
|
||||
#include "PolicyFile.h"
|
||||
#include "Desc.h"
|
||||
|
@ -968,7 +969,10 @@ Val* dbg_eval_expr(const char* expr)
|
|||
|
||||
const BroFunc* func = frame->GetFunction();
|
||||
if ( func )
|
||||
{
|
||||
Ref(func->GetScope());
|
||||
push_existing_scope(func->GetScope());
|
||||
}
|
||||
|
||||
// ### Possibly push a debugger-local scope?
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue