Before running the worker thread, the shared queue must be allocated.
If it's not allocated, the thread will be crashed by the invalid access issue.
Change-Id: I9100ef14e458668452091c89bdeebd3f8beb7d3f
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
if (!disposed_)
return;
- thread_ = std::thread([&]() -> void { WorkerThread(); });
queue_ = new tizen_base::SharedQueue<std::shared_ptr<DBusMessage>>();
+ thread_ = std::thread([&]() -> void { WorkerThread(); });
disposed_ = false;
}
} // namespace
Worker::Worker(std::string name) : name_(std::move(name)) {
- thread_ = std::thread([&]() -> void { RunThread(); });
queue_ = new tizen_base::SharedQueue<std::shared_ptr<Job>>();
+ thread_ = std::thread([&]() -> void { RunThread(); });
}
Worker::~Worker() {