From b989c39bda378f8714974f87f7f18f588c8036eb Mon Sep 17 00:00:00 2001 From: Andreas Pehrson Date: Tue, 30 Nov 2021 17:37:41 +0000 Subject: [PATCH] Bug 1741118 - Don't release GmpPlugin MediaEvents, which hold on to the call thread, on the call thread. r=ng Since bug 1727262 these are fine to release off-target. Differential Revision: https://phabricator.services.mozilla.com/D132222 --- .../webrtc/libwebrtcglue/WebrtcVideoCodecFactory.h | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/dom/media/webrtc/libwebrtcglue/WebrtcVideoCodecFactory.h b/dom/media/webrtc/libwebrtcglue/WebrtcVideoCodecFactory.h index 714b1755049e..a02d132b75f5 100644 --- a/dom/media/webrtc/libwebrtcglue/WebrtcVideoCodecFactory.h +++ b/dom/media/webrtc/libwebrtcglue/WebrtcVideoCodecFactory.h @@ -26,13 +26,8 @@ class GmpPluginNotifier : public GmpPluginNotifierInterface { new MediaEventForwarder(mOwningThread)) {} ~GmpPluginNotifier() { - mOwningThread->Dispatch(NS_NewRunnableFunction( - "~GmpPluginNotifier", - [createdEvent = std::move(mCreatedGmpPluginEvent), - releasedEvent = std::move(mReleasedGmpPluginEvent)]() mutable { - createdEvent->DisconnectAll(); - releasedEvent->DisconnectAll(); - })); + mCreatedGmpPluginEvent->DisconnectAll(); + mReleasedGmpPluginEvent->DisconnectAll(); } MediaEventSource& CreatedGmpPluginEvent() override { @@ -47,8 +42,8 @@ class GmpPluginNotifier : public GmpPluginNotifierInterface { protected: const nsCOMPtr mOwningThread; - RefPtr > mCreatedGmpPluginEvent; - RefPtr > mReleasedGmpPluginEvent; + RefPtr> mCreatedGmpPluginEvent; + RefPtr> mReleasedGmpPluginEvent; }; class WebrtcVideoDecoderFactory : public GmpPluginNotifier,