summaryrefslogtreecommitdiff
path: root/utils/LocIpc.h
diff options
context:
space:
mode:
authorKevin Tang <zhikait@codeaurora.org>2019-04-05 19:46:29 -0700
committerKevin Tang <zhikait@codeaurora.org>2019-04-08 13:36:36 -0700
commit07db01d9af3ac18a2be12bbf58904a6d6fb749f6 (patch)
treedde736ee94edf0e39525244511745a9917d589c6 /utils/LocIpc.h
parentac8ce3c7d5b189a55c9de4ae31b50fa9adb20ddd (diff)
downloadgps-07db01d9af3ac18a2be12bbf58904a6d6fb749f6.tar.gz
LocIpc derefs nullptr if stopping blocking listener
LocIpcRunnable is created only for nonBlocking listeners. But stopListening would use LocIpcRunnable not knowing if this is a blocking or nonblocking listener. LocIpcRunnable is no longer a shared resource between the two threads. We use a copy of string to keep the needed socket name. Change-Id: Ib5c57a89f630807d6d03f3fbc698a56b9ffddf4d CRs-Fixed: 2431397
Diffstat (limited to 'utils/LocIpc.h')
-rw-r--r--utils/LocIpc.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/utils/LocIpc.h b/utils/LocIpc.h
index 87f2ff8..2dee5ff 100644
--- a/utils/LocIpc.h
+++ b/utils/LocIpc.h
@@ -37,6 +37,8 @@
#include <sys/un.h>
#include <LocThread.h>
+using std::string;
+
namespace loc_util {
class LocIpcSender;
@@ -44,7 +46,7 @@ class LocIpcSender;
class LocIpc {
friend LocIpcSender;
public:
- inline LocIpc() : mIpcFd(-1), mRunnable(nullptr) {}
+ inline LocIpc() : mIpcFd(-1) {}
inline virtual ~LocIpc() { stopListening(); }
// Listen for new messages in current thread. Calling this funciton will
@@ -94,7 +96,7 @@ private:
int mIpcFd;
LocThread mThread;
- LocRunnable *mRunnable;
+ string mIpcName;
};
class LocIpcSender {