diff options
author | Glenn Kasten <gkasten@google.com> | 2012-01-27 18:08:45 -0800 |
---|---|---|
committer | Glenn Kasten <gkasten@google.com> | 2012-01-27 18:08:45 -0800 |
commit | e9dd0176933d6233916c84e18f3e8c0d644ca05d (patch) | |
tree | 456651a5f40cbd404d39abb20604817324926db3 /services/audioflinger/AudioPolicyService.cpp | |
parent | fd267d7cf640225bb57f0ed1af44efc153275f6d (diff) | |
download | frameworks_av-e9dd0176933d6233916c84e18f3e8c0d644ca05d.zip frameworks_av-e9dd0176933d6233916c84e18f3e8c0d644ca05d.tar.gz frameworks_av-e9dd0176933d6233916c84e18f3e8c0d644ca05d.tar.bz2 |
Unconditional delete
Don't check that pointer is non-NULL before delete.
Don't leave deleted member fields non-NULL, except in a destructor,
since it could be misleading in a dump or debugger. (mRsmpOutBuffer)
Change-Id: Ic0492a6b752f74a67f4c96dfb89ca2de4e69eecf
Diffstat (limited to 'services/audioflinger/AudioPolicyService.cpp')
-rw-r--r-- | services/audioflinger/AudioPolicyService.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/services/audioflinger/AudioPolicyService.cpp b/services/audioflinger/AudioPolicyService.cpp index 2df1385..7695d2b 100644 --- a/services/audioflinger/AudioPolicyService.cpp +++ b/services/audioflinger/AudioPolicyService.cpp @@ -649,7 +649,7 @@ AudioPolicyService::AudioCommandThread::~AudioCommandThread() release_wake_lock(mName.string()); } mAudioCommands.clear(); - if (mpToneGenerator != NULL) delete mpToneGenerator; + delete mpToneGenerator; } void AudioPolicyService::AudioCommandThread::onFirstRef() @@ -682,8 +682,7 @@ bool AudioPolicyService::AudioCommandThread::threadLoop() ToneData *data = (ToneData *)command->mParam; ALOGV("AudioCommandThread() processing start tone %d on stream %d", data->mType, data->mStream); - if (mpToneGenerator != NULL) - delete mpToneGenerator; + delete mpToneGenerator; mpToneGenerator = new ToneGenerator(data->mStream, 1.0); mpToneGenerator->startTone(data->mType); delete data; |