WeakPtrFactory should populate m_ref lazily.
[WebKit-https.git] / Source / WebCore / Modules / mediastream / MediaDevices.h
index 9f30c3e..6112853 100644 (file)
@@ -82,7 +82,7 @@ private:
     void refEventTarget() override { ref(); }
     void derefEventTarget() override { deref(); }
 
-    WeakPtr<MediaDevices> createWeakPtr() { return m_weakPtrFactory.createWeakPtr(); }
+    WeakPtr<MediaDevices> createWeakPtr() { return m_weakPtrFactory.createWeakPtr(*this); }
 
     Timer m_scheduledEventTimer;
     std::optional<RealtimeMediaSourceCenter::DevicesChangedObserverToken> m_deviceChangedToken;