implement destructor
This commit is contained in:
@@ -10,10 +10,10 @@ rfid_reader::rfid_reader()
|
||||
thread = std::thread(&rfid_reader::loop, this);
|
||||
}
|
||||
|
||||
~rfid_reader::rfid_reader()
|
||||
rfid_reader::~rfid_reader()
|
||||
{
|
||||
|
||||
thread.join();
|
||||
stop_thread = true;
|
||||
if(thread.joinable()) thread.join();
|
||||
}
|
||||
|
||||
uint32_t rfid_reader::last_id() const
|
||||
@@ -23,7 +23,7 @@ uint32_t rfid_reader::last_id() const
|
||||
|
||||
void rfid_reader::loop()
|
||||
{
|
||||
while(true)
|
||||
while(!stop_thread)
|
||||
{
|
||||
if(!mfrc.PICC_IsNewCardPresent())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user