commit | c63f6b055554fbe2748736dc8ec8828970d36973 | [log] [tgz] |
---|---|---|
author | Treehugger Robot <treehugger-gerrit@google.com> | Tue Nov 17 00:27:05 2020 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Tue Nov 17 00:27:05 2020 +0000 |
tree | a729139267fd67f8891b2b3075d01c211ae553f3 | |
parent | 6140d46d41f549ceff103e42270d0ada57705117 [diff] | |
parent | 021cae6f1af714e3a3a648030b99bf416e908896 [diff] |
Merge changes I4e5db32c,I2a448282 am: 5b4e68d756 am: 021cae6f1a Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/1499831 Change-Id: I942835670e7ffe0d64f175ba66e0d2c5f8cbe209
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;