Skip to content

Commit

Permalink
fix: UartUnix receiveData callback being called after destruction (#677)
Browse files Browse the repository at this point in the history
* fix: UartUnix receiveData callback being called after destruction of the object

* Update hal/unix/UartUnix.cpp

---------

Co-authored-by: Richard Peters <[email protected]>
  • Loading branch information
BarisTanyeri and richardapeters authored Jul 15, 2024
1 parent 86fc01d commit 65f164b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion hal/unix/UartUnix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ namespace hal
throw std::system_error(EFAULT, std::system_category());

std::unique_lock lock(mutex);
receivedData(infra::ConstByteRange(range.begin(), range.begin() + size));
if (receivedData != nullptr)
receivedData(infra::ConstByteRange(range.begin(), range.begin() + size));
}
}
}

0 comments on commit 65f164b

Please sign in to comment.