mirror of
				https://github.com/LadybirdBrowser/ladybird.git
				synced 2025-11-01 05:41:01 +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
				
			
		|  | @ -15,6 +15,7 @@ | |||
| #include <LibWeb/Fetch/Infrastructure/HTTP/Responses.h> | ||||
| #include <LibWeb/HTML/HTMLVideoElement.h> | ||||
| #include <LibWeb/HTML/VideoTrack.h> | ||||
| #include <LibWeb/HTML/VideoTrackList.h> | ||||
| #include <LibWeb/Layout/VideoBox.h> | ||||
| #include <LibWeb/Painting/Paintable.h> | ||||
| #include <LibWeb/Platform/ImageCodecPlugin.h> | ||||
|  | @ -36,6 +37,14 @@ void HTMLVideoElement::initialize(JS::Realm& realm) | |||
|     WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLVideoElement); | ||||
| } | ||||
| 
 | ||||
| void HTMLVideoElement::finalize() | ||||
| { | ||||
|     Base::finalize(); | ||||
| 
 | ||||
|     for (auto video_track : video_tracks()->video_tracks()) | ||||
|         video_track->stop_video({}); | ||||
| } | ||||
| 
 | ||||
| void HTMLVideoElement::visit_edges(Cell::Visitor& visitor) | ||||
| { | ||||
|     Base::visit_edges(visitor); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Timothy Flynn
						Timothy Flynn