summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2009-11-09 04:45:39 -0800
committerEric Laurent <elaurent@google.com>2009-11-09 04:45:39 -0800
commit73b603546de3dfee89b9dc9dc725d5c9e12ce40a (patch)
treea11eac769038fd2d0b6c84a1843ea66808847749
parent93572eef41f94f023037482f194db0ab07d0c33a (diff)
downloadframeworks_base-73b603546de3dfee89b9dc9dc725d5c9e12ce40a.zip
frameworks_base-73b603546de3dfee89b9dc9dc725d5c9e12ce40a.tar.gz
frameworks_base-73b603546de3dfee89b9dc9dc725d5c9e12ce40a.tar.bz2
AudioFlinger: delete Track object when createTrack() fails due to lack of tracks in AudioMixer.
This problem was encountered as a side effect of issue 2245298.
-rw-r--r--libs/audioflinger/AudioFlinger.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libs/audioflinger/AudioFlinger.cpp b/libs/audioflinger/AudioFlinger.cpp
index 230e833..ebd470f 100644
--- a/libs/audioflinger/AudioFlinger.cpp
+++ b/libs/audioflinger/AudioFlinger.cpp
@@ -1018,7 +1018,7 @@ sp<AudioFlinger::PlaybackThread::Track> AudioFlinger::PlaybackThread::createTra
Mutex::Autolock _l(mLock);
track = new Track(this, client, streamType, sampleRate, format,
channelCount, frameCount, sharedBuffer);
- if (track->getCblk() == NULL) {
+ if (track->getCblk() == NULL || track->name() < 0) {
lStatus = NO_MEMORY;
goto Exit;
}