X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/4ca6dd275393344b9a27cfb2e5a755a4d74a414f..a6f7c725e21a4b6ed064e92b453331837d12f267:/lib/base/message.h?ds=sidebyside 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 eFixedMessagePump: private eMessagePump, public Object { - eSocketNotifier *sn; + ePtr 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::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 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(); } };