diff --git a/dom/media/MediaDecoderReader.cpp b/dom/media/MediaDecoderReader.cpp index ac6c205db16d..68a0d495205b 100644 --- a/dom/media/MediaDecoderReader.cpp +++ b/dom/media/MediaDecoderReader.cpp @@ -314,8 +314,7 @@ MediaDecoderReader::Shutdown() } else { // If we don't own our task queue, we resolve immediately (though // asynchronously). - p = new ShutdownPromise(__func__); - p->Resolve(true, __func__); + p = ShutdownPromise::CreateAndResolve(true, __func__); } return p;