summaryrefslogtreecommitdiff
path: root/Libraries/LibWeb/Bindings
diff options
context:
space:
mode:
Diffstat (limited to 'Libraries/LibWeb/Bindings')
-rw-r--r--Libraries/LibWeb/Bindings/WindowObject.cpp1
-rw-r--r--Libraries/LibWeb/Bindings/WindowObject.h5
2 files changed, 5 insertions, 1 deletions
diff --git a/Libraries/LibWeb/Bindings/WindowObject.cpp b/Libraries/LibWeb/Bindings/WindowObject.cpp
index 746a81c8fc..7c321f8661 100644
--- a/Libraries/LibWeb/Bindings/WindowObject.cpp
+++ b/Libraries/LibWeb/Bindings/WindowObject.cpp
@@ -45,6 +45,7 @@ namespace Bindings {
WindowObject::WindowObject(Window& impl)
: m_impl(impl)
{
+ impl.set_wrapper({}, *this);
}
void WindowObject::initialize()
diff --git a/Libraries/LibWeb/Bindings/WindowObject.h b/Libraries/LibWeb/Bindings/WindowObject.h
index dff689c8e4..3bc6797249 100644
--- a/Libraries/LibWeb/Bindings/WindowObject.h
+++ b/Libraries/LibWeb/Bindings/WindowObject.h
@@ -26,13 +26,16 @@
#pragma once
+#include <AK/Weakable.h>
#include <LibJS/Runtime/GlobalObject.h>
#include <LibWeb/Forward.h>
namespace Web {
namespace Bindings {
-class WindowObject final : public JS::GlobalObject {
+class WindowObject final
+ : public JS::GlobalObject
+ , public Weakable<WindowObject> {
public:
explicit WindowObject(Window&);
virtual void initialize() override;