Fix seg. fault issue.
The issue happened because invokeThread() callback of AsyncManager class
was called after camera service had been terminated, which in turn,
the callback of branch node tried to access invalid buffer.
So this patch makes sure to wait for the completion of AsyncManager's thread
after the camera service is off.
Change-Id: Ic64f2fd88f880b2eab9ec26b58cc7252bfb16930
Signed-off-by: Inki Dae <inki.dae@samsung.com>
AutoZoom::~AutoZoom()
{
- if (_async_mode)
+ if (_async_mode) {
_input_service->streamOff();
+ _async_manager->destroy();
+ }
_taskManager->clear();
}
_thread_handle = std::make_unique<std::thread>(&AsyncManager::invokeThread, this);
}
- ~AsyncManager()
+ ~AsyncManager() = default;
+
+ void destroy()
{
_exit_thread = true;
_thread_handle->join();