Skip to content

Commit

Permalink
fix a bad_alloc problem
Browse files Browse the repository at this point in the history
  • Loading branch information
Livox-Infra committed Aug 18, 2023
1 parent c116034 commit 852c147
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

All notable changes to this project will be documented in this file.

## [1.2.2]
## [1.2.3]
### Fixed
- Optimize framing logic and reduce CPU usage
- Fixed some known issues

## [1.2.1]
### Fixed
Expand Down
5 changes: 4 additions & 1 deletion src/comm/pub_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,10 @@ void PubHandler::RawDataProcess() {
{
std::unique_lock<std::mutex> lock(packet_mutex_);
if (raw_packet_queue_.empty()) {
packet_condition_.wait_for(lock, std::chrono::milliseconds(500), [this](){return !(this->raw_packet_queue_.empty());});
packet_condition_.wait_for(lock, std::chrono::milliseconds(500));
if (raw_packet_queue_.empty()) {
continue;
}
}
raw_data = raw_packet_queue_.front();
raw_packet_queue_.pop_front();
Expand Down

0 comments on commit 852c147

Please sign in to comment.