some more work on plugin manager
[enigma2.git] / lib / base / message.h
index 038fd55dba642a3d5b168ab1abf43f32c3b577d5..6e9eb07c3629c48b024da8539267a7882ade7bd0 100644 (file)
@@ -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(); }
 };