Skip to content
Commit e9895c19 authored by Andres Calderon Jaramillo's avatar Andres Calderon Jaramillo Committed by Chromium LUCI CQ
Browse files

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: default avatarPilar Molina Lopez <pmolinalopez@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1280458}
parent db2cfad4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment