commit | b008fb2c253e313fd64b66ee9a897f46cbce3208 | [log] [tgz] |
---|---|---|
author | Anthony Stange <stange@google.com> | Mon Jul 15 17:50:17 2019 -0700 |
committer | android-build-merger <android-build-merger@google.com> | Mon Jul 15 17:50:17 2019 -0700 |
tree | e96d87785c56f06fe7f737509c9779a29442efd4 | |
parent | 05a97d2d4bbd563859e4ca45c018af12216eef60 [diff] | |
parent | 65945cfb150ee6f046daa472b4ce71729ee69f1b [diff] |
Verify mPollThread is joinable before detaching am: 65945cfb15 Change-Id: Ia4c4ef1d4e30d8854ee95c9b0cdfb44ad2bb630a
diff --git a/sensors/common/vts/utils/SensorsHidlEnvironmentBase.cpp b/sensors/common/vts/utils/SensorsHidlEnvironmentBase.cpp index affdf8b..fa0e2e9 100644 --- a/sensors/common/vts/utils/SensorsHidlEnvironmentBase.cpp +++ b/sensors/common/vts/utils/SensorsHidlEnvironmentBase.cpp
@@ -29,7 +29,9 @@ void SensorsHidlEnvironmentBase::HidlTearDown() { mStopThread = true; - mPollThread.detach(); + if (mPollThread.joinable()) { + mPollThread.detach(); + } } void SensorsHidlEnvironmentBase::catEvents(std::vector<Event>* output) {