mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 02:28:21 +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
|
@ -10,6 +10,7 @@
|
|||
#include "BroList.h"
|
||||
#include "TraverseTypes.h"
|
||||
|
||||
template <class T> class IntrusivePtr;
|
||||
class ID;
|
||||
class BroType;
|
||||
class ListVal;
|
||||
|
@ -89,7 +90,7 @@ extern void push_scope(ID* id, attr_list* attrs);
|
|||
extern void push_existing_scope(Scope* scope);
|
||||
|
||||
// Returns the one popped off; it's not deleted.
|
||||
extern Scope* pop_scope();
|
||||
extern IntrusivePtr<Scope> pop_scope();
|
||||
extern Scope* current_scope();
|
||||
extern Scope* global_scope();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue