mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-25 02:40:49 +00:00
LibWeb/HTML: Use finalize to clean up MessagePort instances
This commit is contained in:
committed by
Andreas Kling
parent
0b2c80e503
commit
e767029e24
@@ -47,11 +47,7 @@ MessagePort::MessagePort(JS::Realm& realm)
|
||||
all_message_ports().set(this);
|
||||
}
|
||||
|
||||
MessagePort::~MessagePort()
|
||||
{
|
||||
all_message_ports().remove(this);
|
||||
disentangle();
|
||||
}
|
||||
MessagePort::~MessagePort() = default;
|
||||
|
||||
void MessagePort::for_each_message_port(Function<void(MessagePort&)> callback)
|
||||
{
|
||||
@@ -65,6 +61,13 @@ void MessagePort::initialize(JS::Realm& realm)
|
||||
WEB_SET_PROTOTYPE_FOR_INTERFACE(MessagePort);
|
||||
}
|
||||
|
||||
void MessagePort::finalize()
|
||||
{
|
||||
Base::finalize();
|
||||
all_message_ports().remove(this);
|
||||
disentangle();
|
||||
}
|
||||
|
||||
void MessagePort::visit_edges(Cell::Visitor& visitor)
|
||||
{
|
||||
Base::visit_edges(visitor);
|
||||
|
||||
Reference in New Issue
Block a user