While the process is terminating, the DebugPort::Dispose() call causes
SIGSEGV. Because, the context instance already destroyed in that time.
This patch adds a parameter to solve the crash issue. If the do_leave is
false, the method does not close the app com connection.
Change-Id: I69a0471d5a5deaeccab74ed04cb83d445b3f74b9
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
constexpr const char KEY_PORT_NAME[] = "__K_PORT_NAME__";
RPC_DTOR void DebugPortDtor() {
- DebugPort::GetInst()->Dispose();
+ DebugPort::GetInst()->Dispose(false);
}
} // namespace
return inst;
}
-void DebugPort::Dispose() {
+void DebugPort::Dispose(bool do_leave) {
std::lock_guard<std::recursive_mutex> lock(GetMutex());
if (disposed_)
return;
- if (conn_) {
+ if (do_leave && conn_) {
aul_app_com_leave(conn_);
conn_ = nullptr;
}
static DebugPort* GetInst();
- void Dispose();
+ void Dispose(bool do_leave = true);
bool IsConnected();
void AddSession(std::string port_name, std::string destination,