Skip to content
Snippets Groups Projects
Commit 5e994b90 authored by Chih-Yu Huang's avatar Chih-Yu Huang
Browse files

components: pass weak_ptr to Component::Listener

After the component is destroyed, we cannot use shared_from_this()
because there must be a valid shared_ptr pointing to the component.

This CL changes to use weak_from_this() to get weak_ptr, and locks the
weak_ptr when we need shared_ptr. Also, the parameter of
Component::Listener's methods is weak_ptr, instead of shared_ptr.
This CL also changes to pass weak_ptr to the listener.

Bug: 198215986
Test: android.media.cts.VideoEncoderTest#testOtherH264SurfArbitraryH
Change-Id: I3bae943f211db5f68e3b9a86bc193eee09cba65e
parent 8ca36d56
No related branches found
No related tags found
No related merge requests found
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