diff options
| author | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2007-11-14 14:56:16 +0000 |
|---|---|---|
| committer | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2007-11-14 14:56:16 +0000 |
| commit | d4969fafffd49c4791f56141d57281a83007a29b (patch) | |
| tree | 20c7ed14b05fce6b63a484ac9a796289a7adbcba /lib | |
| parent | 466d0d3e9f5f6b6fc409a73ad26f9b0483d12f32 (diff) | |
| download | enigma2-d4969fafffd49c4791f56141d57281a83007a29b.tar.gz enigma2-d4969fafffd49c4791f56141d57281a83007a29b.zip | |
fix frequently segfault on clean shutdown
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/base/ebase.cpp | 10 | ||||
| -rw-r--r-- | lib/base/ebase.h | 8 | ||||
| -rw-r--r-- | lib/dvb/dvb.h | 5 |
3 files changed, 15 insertions, 8 deletions
diff --git a/lib/base/ebase.cpp b/lib/base/ebase.cpp index 08c15610..effd7250 100644 --- a/lib/base/ebase.cpp +++ b/lib/base/ebase.cpp @@ -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(); diff --git a/lib/base/ebase.h b/lib/base/ebase.h index bab1b5f3..4378711a 100644 --- a/lib/base/ebase.h +++ b/lib/base/ebase.h @@ -217,13 +217,7 @@ public: existing_loops.push_back(this); pthread_mutex_init(&recalcLock, 0); } - virtual ~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(); - } + virtual ~eMainloop(); int looplevel() { return loop_level; } diff --git a/lib/dvb/dvb.h b/lib/dvb/dvb.h index b23d047f..e09f0fae 100644 --- a/lib/dvb/dvb.h +++ b/lib/dvb/dvb.h @@ -33,9 +33,12 @@ public: eDVBRegisteredFrontend(eDVBFrontend *fe, iDVBAdapter *adap) :disable(new eTimer(eApp)), m_adapter(adap), m_frontend(fe), m_inuse(0) { - disable = new eTimer(eApp); CONNECT(disable->timeout, eDVBRegisteredFrontend::closeFrontend); } + ~eDVBRegisteredFrontend() + { + delete disable; + } void dec_use() { if (!--m_inuse) |
