mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-28 20:29:42 +00:00
LibWeb: Ensure EventHandler visits its mouse selection target
We hold a raw pointer to the mouse selection target, which is a mixin- style class inherited only by JS::Cell classes. By not visiting this object, we sometime had a dangling reference to it after it had been garbage collected.
This commit is contained in:
committed by
Sam Atkins
parent
18a160e0e9
commit
d5be18617e
@@ -1375,6 +1375,9 @@ void EventHandler::visit_edges(JS::Cell::Visitor& visitor) const
|
||||
{
|
||||
m_drag_and_drop_event_handler->visit_edges(visitor);
|
||||
visitor.visit(m_mouse_event_tracking_paintable);
|
||||
|
||||
if (m_mouse_selection_target)
|
||||
visitor.visit(m_mouse_selection_target->as_cell());
|
||||
}
|
||||
|
||||
Unicode::Segmenter& EventHandler::word_segmenter()
|
||||
|
||||
Reference in New Issue
Block a user