未验证 提交 a87db995 编辑于 作者: Giorgi Guliashvili's avatar Giorgi Guliashvili 提交者: GitHub
浏览文件

memory leak resolve for dispatcher (#4597)

显示 2 个添加2 个删除
+2 -2
......@@ -115,7 +115,7 @@ class InternalRunnable : private boost::noncopyable,
/// An internal runnable used throughout osquery as dispatcher services.
using InternalRunnableRef = std::shared_ptr<InternalRunnable>;
using InternalThreadRef = std::unique_ptr<std::thread>;
using InternalThreadRef = std::shared_ptr<std::thread>;
/**
* @brief Singleton for queuing asynchronous tasks to be executed in parallel
......
......@@ -75,7 +75,7 @@ Status Dispatcher::addService(InternalRunnableRef service) {
return Status(1, "Cannot add service, dispatcher is stopping");
}
auto thread = std::make_unique<std::thread>(
auto thread = std::make_shared<std::thread>(
std::bind(&InternalRunnable::run, &*service));
DLOG(INFO) << "Adding new service: " << service->name() << " ("
......
支持 Markdown
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册