-
Chih-Yu Huang authored
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
Chih-Yu Huang authoredAfter 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