diff options
author | Robin Gareus <robin@gareus.org> | 2017-01-20 13:46:11 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2017-01-20 13:54:03 +0100 |
commit | 8f8d0a70d8a271d754f2a7f5f2cc9a4b38b6a3b0 (patch) | |
tree | b17762d0a796d972fbbc441fc84ecc4a37813df8 /libs/pbd | |
parent | fbae5f5ffda189d178c3e06407f6e17decc7f18e (diff) |
Reap invalidation records
Diffstat (limited to 'libs/pbd')
-rw-r--r-- | libs/pbd/event_loop.cc | 12 | ||||
-rw-r--r-- | libs/pbd/pbd/event_loop.h | 2 |
2 files changed, 13 insertions, 1 deletions
diff --git a/libs/pbd/event_loop.cc b/libs/pbd/event_loop.cc index f72255dd72..e003a8d37a 100644 --- a/libs/pbd/event_loop.cc +++ b/libs/pbd/event_loop.cc @@ -45,6 +45,18 @@ EventLoop::EventLoop (string const& name) { } +EventLoop::~EventLoop () +{ + trash.sort(); + trash.unique(); + for (std::list<InvalidationRecord*>::iterator r = trash.begin(); r != trash.end(); ++r) { + if (!(*r)->in_use ()) { + delete *r; + } + } + trash.clear (); +} + EventLoop* EventLoop::get_event_loop_for_thread() { diff --git a/libs/pbd/pbd/event_loop.h b/libs/pbd/pbd/event_loop.h index 2b661a7e35..5f1f1344dd 100644 --- a/libs/pbd/pbd/event_loop.h +++ b/libs/pbd/pbd/event_loop.h @@ -47,7 +47,7 @@ class LIBPBD_API EventLoop { public: EventLoop (std::string const&); - virtual ~EventLoop() {} + virtual ~EventLoop(); enum RequestType { range_guarantee = ~0 |