+#ifndef SWIG
+ static ePtrList<eMainloop> existing_loops;
+#endif
+
+ eMainloop()
+ :app_quit_now(0),loop_level(0),retval(0), m_interrupt_requested(0)
+ {
+ existing_loops.push_back(this);
+ pthread_mutex_init(&recalcLock, 0);
+ }
+ ~eMainloop()
+ {
+ existing_loops.remove(this);
+ pthread_mutex_destroy(&recalcLock);
+ }