mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-27 14:58:46 +00:00
LibWeb/HTML: Use finalize to clean up MessagePort instances
This commit is contained in:
parent
0b2c80e503
commit
e767029e24
Notes:
github-actions[bot]
2025-01-02 10:39:57 +00:00
Author: https://github.com/shannonbooth
Commit: e767029e24
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3070
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/konradekk
2 changed files with 9 additions and 5 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue