We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(*it)->slot_disconnect(this);
Describe the bug No Gui Application without endless loop, application crash at (*it)->slot_disconnect(this);
void disconnect_all() { lock_block<mt_policy> lock(this); const_iterator it = m_senders.begin(); const_iterator itEnd = m_senders.end(); while(it != itEnd) { (*it)->slot_disconnect(this);// crash c0000005 ++it; } m_senders.erase(m_senders.begin(), m_senders.end()); }
test code:
#include <iostream> #include "SerialPort.h" using namespace itas109; using namespace std; class mySlot : public has_slots<> { public: mySlot(CSerialPort & sp){ m_sp = sp; }; void OnSendMessage() { recLen = m_sp.readAllData(str); if (recLen > 0) { str[recLen] = '\0'; std::cout << "receive data : " << str << ", receive size : " << recLen << std::endl; } }; private: mySlot(){}; private: CSerialPort m_sp; char str[1024]; int recLen; }; int main() { CSerialPort sp; mySlot receive(sp); // while(true); return 0; }
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered:
mySlot(CSerialPort & sp){ m_sp = sp; };
change to (not crash)
mySlot(CSerialPort & sp){ //m_sp = sp; };
Sorry, something went wrong.
this code works
#include <iostream> #include "CSerialPort/SerialPort.h" using namespace itas109; using namespace std; class mySlot : public has_slots<> { public: mySlot(CSerialPort * sp) { p_sp = sp; }; void OnSendMessage() { recLen = p_sp->readAllData(str); if (recLen > 0) { str[recLen] = '\0'; std::cout << "receive data : " << str << ", receive size : " << recLen << std::endl; } }; private: mySlot(){}; private: CSerialPort * p_sp; char str[1024]; int recLen; }; int main() { CSerialPort sp; mySlot receive(&sp); // while(true); return 0; }
336ab48
No branches or pull requests
Describe the bug
No Gui Application without endless loop, application crash at
(*it)->slot_disconnect(this);
test code:
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: