aboutsummaryrefslogtreecommitdiff
path: root/lib/driver
diff options
context:
space:
mode:
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>2008-10-29 19:46:57 +0000
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>2008-10-29 19:46:57 +0000
commit10e7e45ae92d4fe06f70126ed256b87896dbc432 (patch)
treef4b03eb252e5517ccb67be3cd8463c10e14e147c /lib/driver
parent6bb94cd5b0d8fd3608afe84e8d76aef554a4b401 (diff)
downloadenigma2-10e7e45ae92d4fe06f70126ed256b87896dbc432.tar.gz
enigma2-10e7e45ae92d4fe06f70126ed256b87896dbc432.zip
better solution to add possibility to delete eSocketNotifiers,
eConsoleAppContainers in callback funktions without crash
Diffstat (limited to 'lib/driver')
-rw-r--r--lib/driver/avswitch.cpp4
-rw-r--r--lib/driver/avswitch.h2
-rw-r--r--lib/driver/rc.cpp8
-rw-r--r--lib/driver/rc.h4
-rw-r--r--lib/driver/rcconsole.cpp4
-rw-r--r--lib/driver/rcconsole.h2
6 files changed, 8 insertions, 16 deletions
diff --git a/lib/driver/avswitch.cpp b/lib/driver/avswitch.cpp
index 1f2765ec..dbfebf5f 100644
--- a/lib/driver/avswitch.cpp
+++ b/lib/driver/avswitch.cpp
@@ -24,7 +24,7 @@ eAVSwitch::eAVSwitch()
}
else
{
- m_fp_notifier = new eSocketNotifier(eApp, m_fp_fd, eSocketNotifier::Read|POLLERR);
+ m_fp_notifier = eSocketNotifier::create(eApp, m_fp_fd, eSocketNotifier::Read|POLLERR);
CONNECT(m_fp_notifier->activated, eAVSwitch::fp_event);
}
}
@@ -93,8 +93,6 @@ eAVSwitch::~eAVSwitch()
{
if ( m_fp_fd >= 0 )
close(m_fp_fd);
- if (m_fp_notifier)
- delete m_fp_notifier;
}
eAVSwitch *eAVSwitch::getInstance()
diff --git a/lib/driver/avswitch.h b/lib/driver/avswitch.h
index cc92e20e..8fdafdd1 100644
--- a/lib/driver/avswitch.h
+++ b/lib/driver/avswitch.h
@@ -10,7 +10,7 @@ class eAVSwitch: public Object
{
static eAVSwitch *instance;
int m_video_mode;
- eSocketNotifier *m_fp_notifier;
+ ePtr<eSocketNotifier> m_fp_notifier;
void fp_event(int what);
int m_fp_fd;
#ifdef SWIG
diff --git a/lib/driver/rc.cpp b/lib/driver/rc.cpp
index d943352a..c7acd113 100644
--- a/lib/driver/rc.cpp
+++ b/lib/driver/rc.cpp
@@ -79,7 +79,7 @@ eRCShortDriver::eRCShortDriver(const char *filename): eRCDriver(eRCInput::getIns
sn=0;
} else
{
- sn=new eSocketNotifier(eApp, handle, eSocketNotifier::Read);
+ sn=eSocketNotifier::create(eApp, handle, eSocketNotifier::Read);
CONNECT(sn->activated, eRCShortDriver::keyPressed);
eRCInput::getInstance()->setFile(handle);
}
@@ -89,8 +89,6 @@ eRCShortDriver::~eRCShortDriver()
{
if (handle>=0)
close(handle);
- if (sn)
- delete sn;
}
void eRCInputEventDriver::keyPressed(int)
@@ -115,7 +113,7 @@ eRCInputEventDriver::eRCInputEventDriver(const char *filename): eRCDriver(eRCInp
sn=0;
} else
{
- sn=new eSocketNotifier(eApp, handle, eSocketNotifier::Read);
+ sn=eSocketNotifier::create(eApp, handle, eSocketNotifier::Read);
CONNECT(sn->activated, eRCInputEventDriver::keyPressed);
eRCInput::getInstance()->setFile(handle);
}
@@ -133,8 +131,6 @@ eRCInputEventDriver::~eRCInputEventDriver()
{
if (handle>=0)
close(handle);
- if (sn)
- delete sn;
}
eRCConfig::eRCConfig()
diff --git a/lib/driver/rc.h b/lib/driver/rc.h
index 2a776ee4..9708ea7b 100644
--- a/lib/driver/rc.h
+++ b/lib/driver/rc.h
@@ -95,7 +95,7 @@ class eRCShortDriver: public eRCDriver
{
protected:
int handle;
- eSocketNotifier *sn;
+ ePtr<eSocketNotifier> sn;
void keyPressed(int);
public:
eRCShortDriver(const char *filename);
@@ -106,7 +106,7 @@ class eRCInputEventDriver: public eRCDriver
{
protected:
int handle;
- eSocketNotifier *sn;
+ ePtr<eSocketNotifier> sn;
void keyPressed(int);
public:
std::string getDeviceName();
diff --git a/lib/driver/rcconsole.cpp b/lib/driver/rcconsole.cpp
index 53630ca9..05fbec1d 100644
--- a/lib/driver/rcconsole.cpp
+++ b/lib/driver/rcconsole.cpp
@@ -14,7 +14,7 @@ eRCConsoleDriver::eRCConsoleDriver(const char *filename): eRCDriver(eRCInput::ge
sn=0;
} else
{
- sn=new eSocketNotifier(eApp, handle, eSocketNotifier::Read);
+ sn=eSocketNotifier::create(eApp, handle, eSocketNotifier::Read);
CONNECT(sn->activated, eRCConsoleDriver::keyPressed);
eRCInput::getInstance()->setFile(handle);
}
@@ -32,8 +32,6 @@ eRCConsoleDriver::~eRCConsoleDriver()
tcsetattr(handle,TCSANOW, &ot);
if (handle>=0)
close(handle);
- if (sn)
- delete sn;
}
void eRCConsoleDriver::keyPressed(int)
diff --git a/lib/driver/rcconsole.h b/lib/driver/rcconsole.h
index 4af2a4c2..85234d5b 100644
--- a/lib/driver/rcconsole.h
+++ b/lib/driver/rcconsole.h
@@ -9,7 +9,7 @@ class eRCConsoleDriver: public eRCDriver
struct termios ot;
protected:
int handle;
- eSocketNotifier *sn;
+ ePtr<eSocketNotifier> sn;
void keyPressed(int);
public:
eRCConsoleDriver(const char *filename);