diff options
| author | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2008-10-29 22:44:53 +0000 |
|---|---|---|
| committer | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2008-10-29 22:44:53 +0000 |
| commit | 0c59a4279f93f08fe95fca5f2e55f3e025f0cceb (patch) | |
| tree | 71e8c11f2a5487afe84d637d388d3cb060bc9ad5 /lib/components | |
| parent | 4edb65fafb64b52007598e05a1e5b16b75ea752c (diff) | |
| download | enigma2-0c59a4279f93f08fe95fca5f2e55f3e025f0cceb.tar.gz enigma2-0c59a4279f93f08fe95fca5f2e55f3e025f0cceb.zip | |
also use refcounting for eTimers
its now no more possible directly to call new eTimer .. or to embedded
eTimer.
to create a eTimer now eTimer::create must be used... to delete you must
call ->AddRef() after timer creation and ->Release when the timer is no more
needed. Or use ePtr<eTimer> to store the timer reference.. then its enough
to set the ePtr<eTimer> object to 0 when the timer is no more needed
Diffstat (limited to 'lib/components')
| -rw-r--r-- | lib/components/file_eraser.cpp | 8 | ||||
| -rw-r--r-- | lib/components/file_eraser.h | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/components/file_eraser.cpp b/lib/components/file_eraser.cpp index eb9c82f3..031c30dd 100644 --- a/lib/components/file_eraser.cpp +++ b/lib/components/file_eraser.cpp @@ -11,12 +11,12 @@ eBackgroundFileEraser *eBackgroundFileEraser::instance; eBackgroundFileEraser::eBackgroundFileEraser() - :messages(this,1), stop_thread_timer(this) + :messages(this,1), stop_thread_timer(eTimer::create(this)) { if (!instance) instance=this; CONNECT(messages.recv_msg, eBackgroundFileEraser::gotMessage); - CONNECT(stop_thread_timer.timeout, eBackgroundFileEraser::idle); + CONNECT(stop_thread_timer->timeout, eBackgroundFileEraser::idle); } void eBackgroundFileEraser::idle() @@ -44,7 +44,7 @@ void eBackgroundFileEraser::thread() runLoop(); - stop_thread_timer.stop(); + stop_thread_timer->stop(); } void eBackgroundFileEraser::erase(const char *filename) @@ -76,7 +76,7 @@ void eBackgroundFileEraser::gotMessage(const Message &msg ) eDebug("file %s erased", msg.filename); free((char*)msg.filename); } - stop_thread_timer.start(1000, true); // stop thread in one seconds + stop_thread_timer->start(1000, true); // stop thread in one seconds break; case Message::quit: quit(0); diff --git a/lib/components/file_eraser.h b/lib/components/file_eraser.h index 6cb13dda..fd11eca8 100644 --- a/lib/components/file_eraser.h +++ b/lib/components/file_eraser.h @@ -25,7 +25,7 @@ class eBackgroundFileEraser: public eMainloop, private eThread, public Object void gotMessage(const Message &message); void thread(); void idle(); - eTimer stop_thread_timer; + ePtr<eTimer> stop_thread_timer; #ifndef SWIG public: #endif |
