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/ebase.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/ebase.h')
| -rw-r--r-- | lib/base/ebase.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/base/ebase.h b/lib/base/ebase.h index 10b46120..cb676d0b 100644 --- a/lib/base/ebase.h +++ b/lib/base/ebase.h @@ -142,8 +142,9 @@ class eMainloop; * This class emits the signal \c eSocketNotifier::activate whenever the * event specified by \c req is available. */ -class eSocketNotifier +class eSocketNotifier: iObject { + DECLARE_REF(eSocketNotifier); friend class eMainloop; public: enum { Read=POLLIN, Write=POLLOUT, Priority=POLLPRI, Error=POLLERR, Hungup=POLLHUP }; @@ -153,6 +154,7 @@ private: int state; int requested; // requested events (POLLIN, ...) void activate(int what) { /*emit*/ activated(what); } + eSocketNotifier(eMainloop *context, int fd, int req, bool startnow); public: /** * \brief Constructs a eSocketNotifier. @@ -161,7 +163,7 @@ public: * \param req The events to watch to, normally either \c Read or \c Write. You can specify any events that \c poll supports. * \param startnow Specifies if the socketnotifier should start immediately. */ - eSocketNotifier(eMainloop *context, int fd, int req, bool startnow=true); + static eSocketNotifier* create(eMainloop *context, int fd, int req, bool startnow=true) { return new eSocketNotifier(context, fd, req, startnow); } ~eSocketNotifier(); PSignal1<void, int> activated; @@ -173,6 +175,8 @@ public: int getFD() { return fd; } int getRequested() { return requested; } void setRequested(int req) { requested=req; } + + eSmartPtrList<iObject> m_clients; }; #endif |
