Skip to content

Commit

Permalink
ensure delegates are destroyed before their threads
Browse files Browse the repository at this point in the history
  • Loading branch information
iCollin committed May 21, 2020
1 parent 42d6654 commit 30f5e86
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/components/telemetry_monitor/src/telemetry_monitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ void TelemetryMonitor::Stop() {
if (thread_) {
thread_->stop();
thread_->join();
if (thread_->delegate()) {
streamer_.reset();
}
threads::DeleteThread(thread_);
}
thread_ = NULL;
Expand Down
2 changes: 1 addition & 1 deletion src/components/utils/src/timer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ timer::Timer::~Timer() {
StopDelegate();
single_shot_ = true;

DeleteThread(thread_);
delegate_.reset();
DeleteThread(thread_);
DCHECK(task_);
delete task_;
LOG4CXX_DEBUG(logger_, "Timer " << name_ << " has been destroyed");
Expand Down

0 comments on commit 30f5e86

Please sign in to comment.