Skip to content

Commit c1f3d55

Browse files
committed
no smart ptr for thread pool
1 parent ee5c4e8 commit c1f3d55

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/viam/sdk/robot/client.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,11 +290,11 @@ std::shared_ptr<RobotClient> RobotClient::with_channel(std::shared_ptr<ViamChann
290290
robot->refresh_interval_ = options.refresh_interval();
291291
robot->should_refresh_ = (robot->refresh_interval_ > 0);
292292
if (robot->should_refresh_) {
293-
auto t = std::make_unique<std::thread>(&RobotClient::refresh_every, robot);
293+
auto t = std::thread(&RobotClient::refresh_every, robot);
294294
// TODO(RSDK-1743): this was leaking, confirm that adding thread catching in
295295
// close/destructor lets us shutdown gracefully. See also address sanitizer,
296296
// UB sanitizer
297-
t->detach();
297+
t.detach();
298298
robot->threads_.push_back(std::move(t));
299299
};
300300

src/viam/sdk/robot/client.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ class RobotClient {
165165

166166
void refresh_every();
167167

168-
std::vector<std::unique_ptr<std::thread>> threads_;
168+
std::vector<std::thread> threads_;
169169

170170
std::atomic<bool> should_refresh_;
171171
unsigned int refresh_interval_;

0 commit comments

Comments
 (0)