diff options
| author | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2008-10-29 19:46:57 +0000 |
|---|---|---|
| committer | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2008-10-29 19:46:57 +0000 |
| commit | 10e7e45ae92d4fe06f70126ed256b87896dbc432 (patch) | |
| tree | f4b03eb252e5517ccb67be3cd8463c10e14e147c /lib/base/message.h | |
| parent | 6bb94cd5b0d8fd3608afe84e8d76aef554a4b401 (diff) | |
| download | enigma2-10e7e45ae92d4fe06f70126ed256b87896dbc432.tar.gz enigma2-10e7e45ae92d4fe06f70126ed256b87896dbc432.zip | |
better solution to add possibility to delete eSocketNotifiers,
eConsoleAppContainers in callback funktions without crash
Diffstat (limited to 'lib/base/message.h')
| -rw-r--r-- | lib/base/message.h | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/lib/base/message.h b/lib/base/message.h index 038fd55d..6e9eb07c 100644 --- a/lib/base/message.h +++ b/lib/base/message.h @@ -39,7 +39,7 @@ protected: template<class T> class eFixedMessagePump: private eMessagePump, public Object { - eSocketNotifier *sn; + ePtr<eSocketNotifier> sn; void do_recv(int) { T msg; @@ -54,15 +54,10 @@ public: } eFixedMessagePump(eMainloop *context, int mt): eMessagePump(mt) { - sn=new eSocketNotifier(context, getOutputFD(), eSocketNotifier::Read); + sn=eSocketNotifier::create(context, getOutputFD(), eSocketNotifier::Read); CONNECT(sn->activated, eFixedMessagePump<T>::do_recv); sn->start(); } - ~eFixedMessagePump() - { - delete sn; - sn=0; - } void start() { if (sn) sn->start(); } void stop() { if (sn) sn->stop(); } }; @@ -70,7 +65,7 @@ public: class ePythonMessagePump: public eMessagePump, public Object { - eSocketNotifier *sn; + ePtr<eSocketNotifier> sn; void do_recv(int) { int msg; @@ -86,17 +81,10 @@ public: ePythonMessagePump() :eMessagePump(1) { - eDebug("add python messagepump %p", this); - sn=new eSocketNotifier(eApp, getOutputFD(), eSocketNotifier::Read); + sn=eSocketNotifier::create(eApp, getOutputFD(), eSocketNotifier::Read); CONNECT(sn->activated, ePythonMessagePump::do_recv); sn->start(); } - ~ePythonMessagePump() - { - eDebug("remove python messagepump %p", this); - delete sn; - sn=0; - } void start() { if (sn) sn->start(); } void stop() { if (sn) sn->stop(); } }; |
