diff options
author | Glenn Kasten <gkasten@google.com> | 2012-02-03 10:24:48 -0800 |
---|---|---|
committer | Glenn Kasten <gkasten@google.com> | 2012-02-03 16:16:46 -0800 |
commit | 1a0ae5be3d1273cba12584b33830d859510fbf82 (patch) | |
tree | 8073be7b5e33ee230159f7c0aed22bb6de63d3f9 /services/audioflinger/AudioFlinger.cpp | |
parent | 787bae0578fbaab6219ebf23494866b224d01438 (diff) | |
download | frameworks_av-1a0ae5be3d1273cba12584b33830d859510fbf82.zip frameworks_av-1a0ae5be3d1273cba12584b33830d859510fbf82.tar.gz frameworks_av-1a0ae5be3d1273cba12584b33830d859510fbf82.tar.bz2 |
Don't double destruct audio_track_cblk_t
Fortunately audio_track_cblk_t doesn't have a destructor, but for clarity
remove the double destruction.
Also add warning not to add any virtuals to audio_track_cblk_t.
Change-Id: I70ebe1a70460c7002145b2cdf10f9f137396e6f3
Diffstat (limited to 'services/audioflinger/AudioFlinger.cpp')
-rw-r--r-- | services/audioflinger/AudioFlinger.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp index f71ba0a..a5894b6 100644 --- a/services/audioflinger/AudioFlinger.cpp +++ b/services/audioflinger/AudioFlinger.cpp @@ -3324,9 +3324,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 @@ -6970,6 +6971,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 |