commit | e1208a47d2db4d363f48dd59f0f48f95866468a6 | [log] [tgz] |
---|---|---|
author | Treehugger Robot <treehugger-gerrit@google.com> | Tue Nov 17 02:14:37 2020 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Tue Nov 17 02:14:37 2020 +0000 |
tree | 4a1599472ddc1d22deace57f332aeb189f835b6a | |
parent | c12d89c4007702d9e49797fa35499b43a5a4ec17 [diff] | |
parent | ce124d3ca25535b8eac80c9321a7a3be164bda64 [diff] |
Merge changes I4e5db32c,I2a448282 am: 5b4e68d756 am: 021cae6f1a am: c63f6b0555 am: ce124d3ca2 Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/1499831 Change-Id: Iae66e4d73f6e42d705a9a0f425eee12aef73f9e3
diff --git a/libs/binder/ndk/include_cpp/android/binder_auto_utils.h b/libs/binder/ndk/include_cpp/android/binder_auto_utils.h index 8d60226..2d85f90 100644 --- a/libs/binder/ndk/include_cpp/android/binder_auto_utils.h +++ b/libs/binder/ndk/include_cpp/android/binder_auto_utils.h
@@ -74,6 +74,9 @@ * ownership of that other object. */ SpAIBinder& operator=(const SpAIBinder& other) { + if (this == &other) { + return *this; + } AIBinder_incStrong(other.mBinder); set(other.mBinder); return *this; @@ -170,8 +173,10 @@ ScopedAResource& operator=(const ScopedAResource&) = delete; // move-constructing/assignment is okay - ScopedAResource(ScopedAResource&& other) : mT(std::move(other.mT)) { other.mT = DEFAULT; } - ScopedAResource& operator=(ScopedAResource&& other) { + ScopedAResource(ScopedAResource&& other) noexcept : mT(std::move(other.mT)) { + other.mT = DEFAULT; + } + ScopedAResource& operator=(ScopedAResource&& other) noexcept { set(other.mT); other.mT = DEFAULT; return *this;