mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 00:19:53 +01:00
LibWeb/HTML: Unregister ESO during finalize phase
It is generally safer for GC cells to do cleanup work during the finalize phase.
This commit is contained in:
parent
3c0b125c1c
commit
00002c6443
|
|
@ -44,9 +44,10 @@ EnvironmentSettingsObject::EnvironmentSettingsObject(NonnullOwnPtr<JS::Execution
|
|||
responsible_event_loop().register_environment_settings_object({}, *this);
|
||||
}
|
||||
|
||||
EnvironmentSettingsObject::~EnvironmentSettingsObject()
|
||||
void EnvironmentSettingsObject::finalize()
|
||||
{
|
||||
responsible_event_loop().unregister_environment_settings_object({}, *this);
|
||||
Base::finalize();
|
||||
}
|
||||
|
||||
void EnvironmentSettingsObject::initialize(JS::Realm& realm)
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ struct EnvironmentSettingsObject : public Environment {
|
|||
GC_CELL(EnvironmentSettingsObject, Environment);
|
||||
|
||||
public:
|
||||
virtual ~EnvironmentSettingsObject() override;
|
||||
virtual void finalize() override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/webappapis.html#concept-environment-target-browsing-context
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user