summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/AudioFlinger.cpp
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2012-02-08 08:40:15 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-02-08 08:40:15 -0800
commitb61ec89bb0c701b3bd06eb658f854230681f8b39 (patch)
treed1281080768cd8ab98f97cc331e2e7bb27019059 /services/audioflinger/AudioFlinger.cpp
parent63d2daed17ab749baa80bc808fb5083b688b771b (diff)
parent1a0ae5be3d1273cba12584b33830d859510fbf82 (diff)
downloadframeworks_av-b61ec89bb0c701b3bd06eb658f854230681f8b39.zip
frameworks_av-b61ec89bb0c701b3bd06eb658f854230681f8b39.tar.gz
frameworks_av-b61ec89bb0c701b3bd06eb658f854230681f8b39.tar.bz2
Merge "Don't double destruct audio_track_cblk_t"
Diffstat (limited to 'services/audioflinger/AudioFlinger.cpp')
-rw-r--r--services/audioflinger/AudioFlinger.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index 8c0f26a..64dd05f 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -3291,9 +3291,10 @@ AudioFlinger::ThreadBase::TrackBase::TrackBase(
AudioFlinger::ThreadBase::TrackBase::~TrackBase()
{
if (mCblk != NULL) {
- mCblk->~audio_track_cblk_t(); // destroy our shared-structure.
- if (mClient == NULL) {
+ if (mClient == 0) {
delete mCblk;
+ } else {
+ mCblk->~audio_track_cblk_t(); // destroy our shared-structure.
}
}
mCblkMemory.clear(); // and free the shared memory
@@ -6915,6 +6916,7 @@ void AudioFlinger::EffectHandle::disconnect(bool unpiniflast)
mEffect.clear();
if (mClient != 0) {
if (mCblk != NULL) {
+ // unlike ~TrackBase(), mCblk is never a local new, so don't delete
mCblk->~effect_param_cblk_t(); // destroy our shared-structure.
}
mCblkMemory.clear(); // and free the shared memory