summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorYu Yezhong <yuyezhong@gmail.com>2013-10-15 14:32:34 +0800
committerYu Yezhong <yuyezhong@gmail.com>2013-10-15 14:32:34 +0800
commite6056ba0f2399fa3ebea9665e12a8237f99de250 (patch)
tree184e36a01bed4e9b529cc7d46ba820f498e41d4b /services
parentab70649e2b0ea3d917242814417ec5711f4cb811 (diff)
downloadframeworks_av-e6056ba0f2399fa3ebea9665e12a8237f99de250.zip
frameworks_av-e6056ba0f2399fa3ebea9665e12a8237f99de250.tar.gz
frameworks_av-e6056ba0f2399fa3ebea9665e12a8237f99de250.tar.bz2
Frameworks: AudioFlinger: Fix effects memory leak
Patch by: csheng@marvell.com Change-Id: I4e3032fb34643902f98e8fd7c8e894b6452324c9 Signed-off-by: Yu Yezhong <yuyezhong@gmail.com>
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 2706880..94f22b1 100644
--- a/services/audioflinger/AudioPolicyService.cpp
+++ b/services/audioflinger/AudioPolicyService.cpp
@@ -1338,6 +1338,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);