Remove some unused variables.
[ArdourMidi.git] / libs / pbd / event_loop.cc
blob58ab891c4b09ece7ece023d57cf07112aa160a1b
1 #include <iostream>
2 #include "pbd/event_loop.h"
3 #include "pbd/stacktrace.h"
5 using namespace PBD;
6 using namespace std;
8 Glib::StaticPrivate<EventLoop> EventLoop::thread_event_loop;
10 static void do_not_delete_the_loop_pointer (void*) { }
12 EventLoop*
13 EventLoop::get_event_loop_for_thread() {
14 return thread_event_loop.get ();
17 void
18 EventLoop::set_event_loop_for_thread (EventLoop* loop)
20 thread_event_loop.set (loop, do_not_delete_the_loop_pointer);
23 /** Called when a sigc::trackable that was connected to using the invalidator() macro
24 * is destroyed.
26 void*
27 EventLoop::invalidate_request (void* data)
29 InvalidationRecord* ir = (InvalidationRecord*) data;
31 if (ir->event_loop) {
32 Glib::Mutex::Lock lm (ir->event_loop->slot_invalidation_mutex());
33 for (list<BaseRequestObject*>::iterator i = ir->requests.begin(); i != ir->requests.end(); ++i) {
34 cerr << "Object deleted had outstanding event loop request, IR created @ "
35 << ir->file << ':' << ir->line
36 << endl;
37 (*i)->valid = false;
38 (*i)->invalidation = 0;
40 delete ir;
43 return 0;