am 0ba9f9b0: am d8d45edf: am 61540b5f: Merge "Frameworks: AudioFlinger: Fix effects memory leak"

* commit '0ba9f9b07d47e9e6b374798f397fe961256a6029':
  Frameworks: AudioFlinger: Fix effects memory leak
diff --git a/services/audioflinger/AudioPolicyService.cpp b/services/audioflinger/AudioPolicyService.cpp
index c5ad2c0..c8f0730 100644
--- a/services/audioflinger/AudioPolicyService.cpp
+++ b/services/audioflinger/AudioPolicyService.cpp
@@ -1441,6 +1441,14 @@
     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);