Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e6056ba0 authored by Yu Yezhong's avatar Yu Yezhong
Browse files

Frameworks: AudioFlinger: Fix effects memory leak



Patch by: csheng@marvell.com
Change-Id: I4e3032fb34643902f98e8fd7c8e894b6452324c9
Signed-off-by: default avatarYu Yezhong <yuyezhong@gmail.com>
parent ab70649e
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -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);