소스 검색

LibWeb: Don't have Handle<Realm> in WindowEnvironmentSettingsObject

This was preventing window realms from ever being garbage collected.
Andreas Kling 2 년 전
부모
커밋
c569c88e63

+ 1 - 1
Userland/Libraries/LibWeb/HTML/Scripting/WindowEnvironmentSettingsObject.cpp

@@ -12,7 +12,7 @@ namespace Web::HTML {
 
 WindowEnvironmentSettingsObject::WindowEnvironmentSettingsObject(Window& window, NonnullOwnPtr<JS::ExecutionContext> execution_context)
     : EnvironmentSettingsObject(move(execution_context))
-    , m_window(JS::make_handle(window))
+    , m_window(window)
 {
 }
 

+ 1 - 1
Userland/Libraries/LibWeb/HTML/Scripting/WindowEnvironmentSettingsObject.h

@@ -26,7 +26,7 @@ public:
 private:
     WindowEnvironmentSettingsObject(Window&, NonnullOwnPtr<JS::ExecutionContext>);
 
-    JS::Handle<Window> m_window;
+    WeakPtr<Window> m_window;
 };
 
 }