summaryrefslogtreecommitdiff
path: root/libs/pbd/event_loop.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2010-03-30 15:18:43 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2010-03-30 15:18:43 +0000
commit14b0ca31bcb62e5b7e9e77634ef9cd2e8cf65800 (patch)
tree494bcf5351ff29d9981c22450863982b93a91a71 /libs/pbd/event_loop.cc
parent10c257039df399fc5a9c383434ee19abab6199ed (diff)
handle deletion of UI objects between the time that a callback is queued with the UI event loop and the execution of the callback (intrusive, big)
git-svn-id: svn://localhost/ardour2/branches/3.0@6807 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/pbd/event_loop.cc')
-rw-r--r--libs/pbd/event_loop.cc29
1 files changed, 29 insertions, 0 deletions
diff --git a/libs/pbd/event_loop.cc b/libs/pbd/event_loop.cc
index 3bc4abcbdf..69223efe49 100644
--- a/libs/pbd/event_loop.cc
+++ b/libs/pbd/event_loop.cc
@@ -1,6 +1,9 @@
+#include <iostream>
#include "pbd/event_loop.h"
+#include "pbd/stacktrace.h"
using namespace PBD;
+using namespace std;
Glib::StaticPrivate<EventLoop> EventLoop::thread_event_loop;
@@ -17,3 +20,29 @@ EventLoop::set_event_loop_for_thread (EventLoop* loop)
thread_event_loop.set (loop, do_not_delete_the_loop_pointer);
}
+void*
+EventLoop::invalidate_request (void* data)
+{
+ InvalidationRecord* ir = (InvalidationRecord*) data;
+
+ if (ir->event_loop) {
+ Glib::Mutex::Lock lm (ir->event_loop->slot_invalidation_mutex());
+ if (ir->request) {
+ cerr << "Object deleted had outstanding event loop request, IR created @ "
+ << ir->file << ':' << ir->line
+ << endl;
+ ir->request->valid = false;
+ ir->request->invalidation = 0;
+ } else {
+ cerr << "No queued request associated with object deletion from "
+ << ir->file << ':' << ir->line
+ << endl;
+
+ }
+
+ delete ir;
+ }
+
+ return 0;
+}
+