app-manager takes care of its own instancepointer in slot
authorRonny Strutz <ronny.strutz@multimedia-labs.de>
Fri, 18 Nov 2005 03:35:39 +0000 (03:35 +0000)
committerRonny Strutz <ronny.strutz@multimedia-labs.de>
Fri, 18 Nov 2005 03:35:39 +0000 (03:35 +0000)
lib/dvb_ci/dvbci.cpp
lib/dvb_ci/dvbci_appmgr.cpp
lib/dvb_ci/dvbci_appmgr.h
lib/dvb_ci/dvbci_session.cpp

index 71994538aa4bac8c981cb5bbbb38bcd7891f0e7b..4e5b6e688b38a5a03a26c336e560c44c7c499455 100644 (file)
@@ -140,9 +140,6 @@ void eDVBCISlot::data(int what)
                        notifier->setRequested(eSocketNotifier::Read);
                        //HACK
                        eDVBCI_UI::getInstance()->setState(0,0);
-                       //FIXME; do in deconstructor of the appmgr class                        
-                       application_manager = 0;
-                       mmi_session = 0;
                }
                return;
        }
@@ -185,10 +182,10 @@ DEFINE_REF(eDVBCISlot);
 eDVBCISlot::eDVBCISlot(eMainloop *context, int nr)
 {
        char filename[128];
-       
+
        application_manager = 0;
        mmi_session = 0;
-
+       
        slotid = nr;
 
        sprintf(filename, "/dev/ci%d", nr);
index f07ea9997a550f6aa0f8abacdc2486b61f1aae44..7843554d685e4df51c5197af51e58e9bf682e988 100644 (file)
@@ -3,6 +3,17 @@
 #include <lib/dvb_ci/dvbci_appmgr.h>
 #include <lib/dvb_ci/dvbci_ui.h>
 
+eDVBCIApplicationManagerSession::eDVBCIApplicationManagerSession(eDVBCISlot *tslot)
+{
+       slot = tslot;
+       slot->application_manager       = this;
+}
+
+eDVBCIApplicationManagerSession::~eDVBCIApplicationManagerSession()
+{
+       slot = 0;
+}
+
 int eDVBCIApplicationManagerSession::receivedAPDU(const unsigned char *tag,const void *data, int len)
 {
        printf("SESSION(%d)/APP %02x %02x %02x: ", session_nb, tag[0], tag[1], tag[2]);
index 1d6e7b151182575117f67311176f1d16736619ae..7a94bafcb0ddfaa47857ab6249affba94ea48d37 100644 (file)
@@ -8,10 +8,15 @@ class eDVBCIApplicationManagerSession: public eDVBCISession
        enum {
                stateFinal=statePrivate,
        };
+       
+       eDVBCISlot *slot;
+       
        int wantmenu;
        int receivedAPDU(const unsigned char *tag, const void *data, int len);
        int doAction();
 public:
+       eDVBCIApplicationManagerSession(eDVBCISlot *tslot);
+       ~eDVBCIApplicationManagerSession();
        int enterMenu();
        int startMMI();
 };
index a0171a3dff407f8d2772801d42c22c612983a44c..bb8ba8691ac5c46f3a2079cd6419902b9ae92148 100644 (file)
@@ -136,7 +136,7 @@ eDVBCISession *eDVBCISession::createSession(eDVBCISlot *slot, const unsigned cha
                printf("session: %p\n",session);
                break;
        case 0x00020041:
-               session=slot->application_manager = new eDVBCIApplicationManagerSession;
+               session=slot->application_manager = new eDVBCIApplicationManagerSession(slot);
                printf("APPLICATION MANAGER\n");
                break;
        case 0x00030041: