Cleanup various clang warnings, use unique_ptrs in several places
Change-Id: I347904b25e51fcc7de14b1e72f1acd0f6ba26f3f
diff --git a/libs/hwui/Animator.cpp b/libs/hwui/Animator.cpp
index a1bbc06..805f844 100644
--- a/libs/hwui/Animator.cpp
+++ b/libs/hwui/Animator.cpp
@@ -36,7 +36,6 @@
, mFinalValue(finalValue)
, mDeltaValue(0)
, mFromValue(0)
- , mInterpolator(0)
, mStagingPlayState(NOT_STARTED)
, mPlayState(NOT_STARTED)
, mHasStartValue(false)
@@ -47,7 +46,6 @@
}
BaseRenderNodeAnimator::~BaseRenderNodeAnimator() {
- delete mInterpolator;
}
void BaseRenderNodeAnimator::checkMutable() {
@@ -58,8 +56,7 @@
void BaseRenderNodeAnimator::setInterpolator(Interpolator* interpolator) {
checkMutable();
- delete mInterpolator;
- mInterpolator = interpolator;
+ mInterpolator.reset(interpolator);
}
void BaseRenderNodeAnimator::setStartValue(float value) {
@@ -119,7 +116,7 @@
}
// No interpolator was set, use the default
if (!mInterpolator) {
- mInterpolator = Interpolator::createDefaultInterpolator();
+ mInterpolator.reset(Interpolator::createDefaultInterpolator());
}
if (mDuration < 0 || mDuration > 50000) {
ALOGW("Your duration is strange and confusing: %" PRId64, mDuration);