add config option 'Show blinking clock in display during recording'
[enigma2.git] / lib / base / ebase.cpp
index 93bfd3425b5425360d2e28568239b0f293a9087a..effd7250924a2ed224df80b1b82888b1ede0efab 100644 (file)
@@ -116,6 +116,16 @@ void eTimer::addTimeOffset( int offset )
 // mainloop
 ePtrList<eMainloop> eMainloop::existing_loops;
 
+eMainloop::~eMainloop()
+{
+       existing_loops.remove(this);
+       pthread_mutex_destroy(&recalcLock);
+       for (std::map<int, eSocketNotifier*>::iterator it(notifiers.begin());it != notifiers.end();++it)
+               it->second->stop();
+       while(m_timer_list.begin() != m_timer_list.end())
+               m_timer_list.begin()->stop();
+}
+
 void eMainloop::addSocketNotifier(eSocketNotifier *sn)
 {
        int fd = sn->getFD();
@@ -197,12 +207,17 @@ int eMainloop::processOneEvent(unsigned int twisted_timeout, PyObject **res, ePy
                }
        }
 
+       m_is_idle = 1;
+
        if (this == eApp)
+       {
                Py_BEGIN_ALLOW_THREADS
                ret = ::poll(pfd, fdcount, poll_timeout);
                Py_END_ALLOW_THREADS
-       else
+       else
                ret = ::poll(pfd, fdcount, poll_timeout);
+       
+       m_is_idle = 0;
 
                        /* ret > 0 means that there are some active poll entries. */
        if (ret > 0)