use sp<AudioEffect> instead of unique_ptr<AudioEffect>
As a child class of RefBase, an AudioEffect object should be held by sp<> rather than by unique_ptr<>.
If you use unique_ptr<> to hold it, then later, someone else, on the other hand, may probably use sp<> to hold it, then in the future, the AudioEffect object may be deleted two times: one is from sp<>, the other from unique_ptr<>.
This may be detected by the destructor of class RefBase, with the log complaint "RefBase: Explicit destruction,..."
Test: monkey test for one day and one night
Signed-off-by: Jintao Zhu <zhujtcsieee@gmail.com>
Change-Id: I52e1df86899dfd8265aa80b4d3423936f66fcd47
Loading
Please register or sign in to comment