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

Skip to content
Commit 69d41cc6 authored by Mikhail Naganov's avatar Mikhail Naganov
Browse files

Avoid storing 'this' in a wp<AudioEffect> while in constructor

Storing 'this' into wp<AudioEffect> while running the constructor
of an AudioEffect can lead to premature instance destruction
because the owner of this weak pointer may promote to sp<>
on a thread running in parallel to the constructor.

Fixed by removing a call to AudioEffect::set from the constructor
and moving the responsibility for calling it to client code.

Bug: 162012829
Bug: 162323621
Test: repro steps from the bug
      atest android.media.cts.VisualizerTest
Change-Id: Ice5f510b1c9020b5ba73bd6223c1669ab8eae24c
Merged-In: Ice5f510b1c9020b5ba73bd6223c1669ab8eae24c
parent 1fc724e9
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment