mirror of
https://github.com/zeek/zeek.git
synced 2025-10-12 11:38:20 +00:00
Clean up triggers awaiting global state modification at shutdown
Otherwise they can be reported as memory leaks since no more global state modifications will take place to notify the trigger to clean itself up.
This commit is contained in:
parent
5e73949327
commit
9e494452f1
5 changed files with 49 additions and 0 deletions
|
@ -30,6 +30,12 @@ public:
|
|||
* @param m object that was modified
|
||||
*/
|
||||
virtual void Modified(Modifiable* m) = 0;
|
||||
|
||||
/**
|
||||
* Callback executed when notification registry is terminating and
|
||||
* no further modifications can possibly occur.
|
||||
*/
|
||||
virtual void Terminate() { }
|
||||
};
|
||||
|
||||
/** Singleton class tracking all notification requests globally. */
|
||||
|
@ -69,6 +75,12 @@ public:
|
|||
*/
|
||||
void Unregister(Modifiable* m);
|
||||
|
||||
/**
|
||||
* Notifies all receivers that no further modifications will occur
|
||||
* as the registry is shutting down.
|
||||
*/
|
||||
void Terminate();
|
||||
|
||||
private:
|
||||
friend class Modifiable;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue