diff options
-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 |