summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@android.com>2014-01-10 17:22:39 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-01-10 17:22:40 +0000
commit61540b5fe82cad1c6baa018f02bd2554e62e4364 (patch)
treebc1a94ff57fe9293c873fe412611e16b748da75e /services
parent5ca94d2f3c4662aed7b66a97b77eb2d1948464ad (diff)
parente6056ba0f2399fa3ebea9665e12a8237f99de250 (diff)
downloadframeworks_av-61540b5fe82cad1c6baa018f02bd2554e62e4364.zip
frameworks_av-61540b5fe82cad1c6baa018f02bd2554e62e4364.tar.gz
frameworks_av-61540b5fe82cad1c6baa018f02bd2554e62e4364.tar.bz2
Merge "Frameworks: AudioFlinger: Fix effects memory leak"
Diffstat (limited to 'services')
-rw-r--r--services/audioflinger/AudioPolicyService.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/services/audioflinger/AudioPolicyService.cpp b/services/audioflinger/AudioPolicyService.cpp
index 35e816b..646a317 100644
--- a/services/audioflinger/AudioPolicyService.cpp
+++ b/services/audioflinger/AudioPolicyService.cpp
@@ -1433,6 +1433,14 @@ status_t AudioPolicyService::loadPreProcessorConfig(const char *path)
loadEffects(root, effects);
loadInputSources(root, effects);
+ // delete effects to fix memory leak.
+ // as effects is local var and valgrind would treat this as memory leak
+ // and although it only did in mediaserver init, but free it in case mediaserver reboot
+ size_t i;
+ for (i = 0; i < effects.size(); i++) {
+ delete effects[i];
+ }
+
config_free(root);
free(root);
free(data);