mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 11:52:44 +00:00 
			
		
		
		
	LibWeb: Visit custom element's lifecycle callbacks
...instead of using JS::Handle which causes leaks when object holding the callback can be reached by visiting the callback's dependencies.
This commit is contained in:
		
							parent
							
								
									3d48c55e50
								
							
						
					
					
						commit
						3b4230e0b0
					
				
					 5 changed files with 26 additions and 5 deletions
				
			
		|  | @ -0,0 +1,18 @@ | |||
| /*
 | ||||
|  * Copyright (c) 2024, Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com> | ||||
|  * | ||||
|  * SPDX-License-Identifier: BSD-2-Clause | ||||
|  */ | ||||
| 
 | ||||
| #include <LibWeb/HTML/CustomElements/CustomElementDefinition.h> | ||||
| 
 | ||||
| namespace Web::HTML { | ||||
| 
 | ||||
| void CustomElementDefinition::visit_edges(Visitor& visitor) | ||||
| { | ||||
|     Base::visit_edges(visitor); | ||||
|     for (auto& callback : m_lifecycle_callbacks) | ||||
|         visitor.visit(callback.value); | ||||
| } | ||||
| 
 | ||||
| } | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Aliaksandr Kalenik
						Aliaksandr Kalenik