From: Hwankyu Jhun Date: Wed, 20 Oct 2021 09:02:04 +0000 (+0900) Subject: Set nullptr to the listener ptr X-Git-Tag: accepted/tizen/6.5/unified/20211109.041712~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ae37392df94f75761c83c497b0281dfedf616042;p=platform%2Fcore%2Fappfw%2Frpc-port.git Set nullptr to the listener ptr When the timed out error occurred, the listener ptr should be nullptr. While calling the rejected callback function, the proxy process tries to connect to the stub process. Change-Id: I48b03e9eaa56f832c45b26384f0bf8c3aa5c0ad1 Signed-off-by: Hwankyu Jhun --- diff --git a/src/proxy-internal.cc b/src/proxy-internal.cc index 91cb63e..098f742 100644 --- a/src/proxy-internal.cc +++ b/src/proxy-internal.cc @@ -188,12 +188,12 @@ int Proxy::Connect(std::string appid, std::string port_name, if (listener == nullptr) return RPC_PORT_ERROR_INVALID_PARAMETER; + std::lock_guard lock(GetMutex()); if (listener_ != nullptr) { _D("Already requested"); return RPC_PORT_ERROR_INVALID_PARAMETER; } - std::lock_guard lock(GetMutex()); listener_ = listener; target_appid_ = std::move(appid); port_name_ = std::move(port_name); @@ -441,6 +441,7 @@ gboolean Proxy::OnTimedOut(gpointer user_data) { return G_SOURCE_REMOVE; } + proxy->listener_ = nullptr; listener->OnRejected(proxy->target_appid_, RPC_PORT_ERROR_IO_ERROR); return G_SOURCE_REMOVE; }