mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-09 04:32:51 +00:00
LibWeb: Stop the video decoder thread when the video element is GC'd
Otherwise, the thread will continue to run and access the media data buffer, which will have been freed. The test here is a bit strange, but the issue would only consistently repro after several GC runs.
This commit is contained in:
parent
f13ccb9a61
commit
f6407276f7
Notes:
sideshowbarker
2024-07-17 02:22:23 +09:00
Author: https://github.com/trflynn89
Commit: f6407276f7
Pull-request: https://github.com/SerenityOS/serenity/pull/24110
Issue: https://github.com/SerenityOS/serenity/issues/24044
8 changed files with 45 additions and 2 deletions
|
@ -98,6 +98,11 @@ void VideoTrack::pause_video(Badge<HTMLVideoElement>)
|
|||
m_playback_manager->pause_playback();
|
||||
}
|
||||
|
||||
void VideoTrack::stop_video(Badge<HTMLVideoElement>)
|
||||
{
|
||||
m_playback_manager->terminate_playback();
|
||||
}
|
||||
|
||||
Duration VideoTrack::position() const
|
||||
{
|
||||
return m_playback_manager->current_playback_time();
|
||||
|
@ -141,7 +146,7 @@ void VideoTrack::set_selected(bool selected)
|
|||
// no longer in a VideoTrackList object, then the track being selected or unselected has no effect beyond changing the value of
|
||||
// the attribute on the VideoTrack object.)
|
||||
if (m_video_track_list) {
|
||||
for (auto video_track : m_video_track_list->video_tracks({})) {
|
||||
for (auto video_track : m_video_track_list->video_tracks()) {
|
||||
if (video_track.ptr() != this)
|
||||
video_track->m_selected = false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue