diff options
-rw-r--r-- | src/AntFr310XT.cpp | 5 | ||||
-rw-r--r-- | src/AntFr310XT.hpp | 2 | ||||
-rw-r--r-- | src/antpm-downloader.cpp | 2 |
3 files changed, 7 insertions, 2 deletions
diff --git a/src/AntFr310XT.cpp b/src/AntFr310XT.cpp index ae4a96c..3690743 100644 --- a/src/AntFr310XT.cpp +++ b/src/AntFr310XT.cpp @@ -103,7 +103,7 @@ AntFr310XT::AntFr310XT(bool eventLoopInBgTh) AntFr310XT::~AntFr310XT() { - m_antMessenger->setCallback(0); + if(m_antMessenger) m_antMessenger->setCallback(0); //m_antMessenger->setHandler(0); m_eventThKill=1; @@ -202,6 +202,9 @@ void AntFr310XT::stop() m_antMessenger->ANT_CloseChannel(chan); m_antMessenger->ANT_ResetSystem(); } + if(m_antMessenger) m_antMessenger->setCallback(0); + //m_antMessenger->setHandler(0); + m_antMessenger.reset(); if(m_serial) m_serial->close(); changeState(ST_ANTFS_START0, true); } diff --git a/src/AntFr310XT.hpp b/src/AntFr310XT.hpp index 169e164..308d3e6 100644 --- a/src/AntFr310XT.hpp +++ b/src/AntFr310XT.hpp @@ -47,7 +47,9 @@ public: virtual void onAntSent(const AntMessage m); void start(); +protected: void stop(); +public: void stopAsync(); const int getSMState() const; diff --git a/src/antpm-downloader.cpp b/src/antpm-downloader.cpp index b5591a8..04ad0e9 100644 --- a/src/antpm-downloader.cpp +++ b/src/antpm-downloader.cpp @@ -243,7 +243,7 @@ main(int argc, char** argv) watch2.start(); - watch2.stop(); + //watch2.stop(); } } |