summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/PatchPanel.cpp
diff options
context:
space:
mode:
authorsoon1.choi <soon1.choi@lge.com>2015-01-05 14:27:42 +0900
committerSoon-won Choi <soon1.choi@lge.com>2015-01-05 07:57:42 +0000
commitd8cd47792bac11a44096ef8233bb5268a6674bec (patch)
treea297a02667e5b2dbed97c6aa03afda3c33aaab1b /services/audioflinger/PatchPanel.cpp
parentbd08223c450a7a2e8e8d79e6be148ed1ac64caa3 (diff)
downloadframeworks_av-d8cd47792bac11a44096ef8233bb5268a6674bec.zip
frameworks_av-d8cd47792bac11a44096ef8233bb5268a6674bec.tar.gz
frameworks_av-d8cd47792bac11a44096ef8233bb5268a6674bec.tar.bz2
fix memory leak in PatchPanel
Before the audio patch is created, audio patch with same handle is removed from vector for patches. At this time, Patch allocated in the heap is not freed. This causes memory leaks in the mediaserver. Change-Id: Id0d28c36a7e7fbf473753bf4ead7518f28c1b998
Diffstat (limited to 'services/audioflinger/PatchPanel.cpp')
-rw-r--r--services/audioflinger/PatchPanel.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/services/audioflinger/PatchPanel.cpp b/services/audioflinger/PatchPanel.cpp
index 7544052..4f0c6b1 100644
--- a/services/audioflinger/PatchPanel.cpp
+++ b/services/audioflinger/PatchPanel.cpp
@@ -166,7 +166,9 @@ status_t AudioFlinger::PatchPanel::createAudioPatch(const struct audio_patch *pa
if (*handle == mPatches[index]->mHandle) {
ALOGV("createAudioPatch() removing patch handle %d", *handle);
halHandle = mPatches[index]->mHalHandle;
+ Patch *removedPatch = mPatches[index];
mPatches.removeAt(index);
+ delete removedPatch;
break;
}
}