Merge "Wait until old ComposerClient is fully destroyed before recreating" into qt-dev am: d93c9f0c2d
am: 5cb7cc40a7
Change-Id: Icee6b0fb3599a6c32d039daa0d18deb719db443e
diff --git a/graphics/composer/2.1/utils/hal/include/composer-hal/2.1/Composer.h b/graphics/composer/2.1/utils/hal/include/composer-hal/2.1/Composer.h
index ad985da..90d9b98 100644
--- a/graphics/composer/2.1/utils/hal/include/composer-hal/2.1/Composer.h
+++ b/graphics/composer/2.1/utils/hal/include/composer-hal/2.1/Composer.h
@@ -109,12 +109,10 @@
// inverted (create and then destroy). Wait for a brief period to
// see if the existing client is destroyed.
ALOGD("waiting for previous client to be destroyed");
- mClientDestroyedCondition.wait_for(
- lock, 1s, [this]() -> bool { return mClient.promote() == nullptr; });
- if (mClient.promote() != nullptr) {
+ mClientDestroyedCondition.wait_for(lock, 1s,
+ [this]() -> bool { return mClient == nullptr; });
+ if (mClient != nullptr) {
ALOGD("previous client was not destroyed");
- } else {
- mClient.clear();
}
}