media: Fix destruction order in MojoStableVideoDecoder tests
This CL fixes a potential dangling pointer in the MojoStableVideoDecoder unit tests. The issue manifests when the TestEndpoints instance is destroyed before the MojoStableVideoDecoder::media_log_ raw_ptr becomes null. In that case, the TestEndpoints destructor will post a task to the media task runner but (before this CL) would then immediately destroy the NullMediaLog that the MojoStableVideoDecoder::media_log_ points to thus making the latter dangling. The solution in this CL is to also post a task to the media task runner to destroy the NullMediaLog after the MojoStableVideoDecoder. Bug: b:327268445 Test: media_unittests --gtest_filter="MojoStableVideoDecoder*" Change-Id: I717cc4481384fc2a3691a1c040d23b53b7d6b301 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5406862 Commit-Queue: Andres Calderon Jaramillo <andrescj@chromium.org> Reviewed-by:Pilar Molina Lopez <pmolinalopez@chromium.org> Cr-Commit-Position: refs/heads/main@{#1280458}
Loading
Please register or sign in to comment