summaryrefslogtreecommitdiffstats
path: root/src/itf/IAndroidEffect.cpp
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2015-06-04 16:20:56 -0700
committerEric Laurent <elaurent@google.com>2015-06-08 18:53:44 -0700
commitaa08cb01d58f1da2d0a2b208aed3bf1730f8f63d (patch)
tree7bc62533282f5c607bbba25737acc3c171a52dcb /src/itf/IAndroidEffect.cpp
parent09aeff183fa1353298c47fcb18ff33b0d08a990d (diff)
downloadandroid_frameworks_wilhelm-aa08cb01d58f1da2d0a2b208aed3bf1730f8f63d.tar.gz
android_frameworks_wilhelm-aa08cb01d58f1da2d0a2b208aed3bf1730f8f63d.tar.bz2
android_frameworks_wilhelm-aa08cb01d58f1da2d0a2b208aed3bf1730f8f63d.zip
Use only strong references to AudioEffect
Do not use raw pointers to native AudioEffect objects. Bug: 21629892. Change-Id: Ib6af552503584c5f0532ff6dee2829da6e10ac88
Diffstat (limited to 'src/itf/IAndroidEffect.cpp')
-rw-r--r--src/itf/IAndroidEffect.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/itf/IAndroidEffect.cpp b/src/itf/IAndroidEffect.cpp
index f34cabd..8e5ab7c 100644
--- a/src/itf/IAndroidEffect.cpp
+++ b/src/itf/IAndroidEffect.cpp
@@ -108,7 +108,8 @@ void IAndroidEffect_init(void *self)
{
IAndroidEffect *thiz = (IAndroidEffect *) self;
thiz->mItf = &IAndroidEffect_Itf;
- thiz->mEffects = new android::KeyedVector<SLuint32, android::AudioEffect* >();
+ thiz->mEffects =
+ new android::KeyedVector<SLuint32, android::sp<android::AudioEffect> >();
}
void IAndroidEffect_deinit(void *self)
@@ -116,9 +117,6 @@ void IAndroidEffect_deinit(void *self)
IAndroidEffect *thiz = (IAndroidEffect *) self;
if (NULL != thiz->mEffects) {
if (!thiz->mEffects->isEmpty()) {
- for (size_t i = 0 ; i < thiz->mEffects->size() ; i++) {
- delete thiz->mEffects->valueAt(i);
- }
thiz->mEffects->clear();
}
delete thiz->mEffects;