clear up some CSS padding/margin confusion, and add row/col spacing
[ardour.git] / libs / pbd / event_loop.cc
index aae0c21a08cf740d8f0a33f91fa47a8e3401bf2b..e003a8d37a0ccaa635c6c8eab757dbdc939d326f 100644 (file)
@@ -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()
 {
@@ -88,18 +100,9 @@ EventLoop::invalidate_request (void* data)
 
        if (ir->event_loop) {
                DEBUG_TRACE (PBD::DEBUG::AbstractUI, string_compose ("%1: EventLoop::invalidate_request %2\n", ir->event_loop, ir));
-               {
-                       Glib::Threads::Mutex::Lock lm (ir->event_loop->slot_invalidation_mutex());
-                       for (list<BaseRequestObject*>::iterator i = ir->requests.begin(); i != ir->requests.end(); ++i) {
-                               (*i)->invalidate ();
-                               (*i)->invalidation = 0;
-                       }
-               }
-               // This invalidation record may still be in-use in per-thread-request-ringbuffer.
-               // it cannot be deleted here,
+               Glib::Threads::Mutex::Lock lm (ir->event_loop->slot_invalidation_mutex());
+               ir->invalidate ();
                ir->event_loop->trash.push_back(ir);
-       } else {
-               DEBUG_TRACE (PBD::DEBUG::AbstractUI, string_compose ("EventLoop::invalidate_request no event-loop for invalidation %1\n", ir));
        }
 
        return 0;