mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-20 16:55:40 +00:00
Bug 1319190 - Make sure we release the last VideoDecoderChild ref on the video manager thread. r=dvander
--HG-- extra : rebase_source : 52450808793a3be6abd04fe7be345d3ac1b608d3
This commit is contained in:
parent
1c5f147c9f
commit
6c7788b023
@ -37,10 +37,18 @@ RemoteVideoDecoder::~RemoteVideoDecoder()
|
||||
// task queue for the VideoDecoderChild thread to keep
|
||||
// it alive until we send the delete message.
|
||||
RefPtr<VideoDecoderChild> actor = mActor;
|
||||
VideoDecoderManagerChild::GetManagerThread()->Dispatch(NS_NewRunnableFunction([actor]() {
|
||||
|
||||
RefPtr<Runnable> task = NS_NewRunnableFunction([actor]() {
|
||||
MOZ_ASSERT(actor);
|
||||
actor->DestroyIPDL();
|
||||
}), NS_DISPATCH_NORMAL);
|
||||
});
|
||||
|
||||
// Drop out references to the actor so that the last ref
|
||||
// always gets released on the manager thread.
|
||||
actor = nullptr;
|
||||
mActor = nullptr;
|
||||
|
||||
VideoDecoderManagerChild::GetManagerThread()->Dispatch(task.forget(), NS_DISPATCH_NORMAL);
|
||||
}
|
||||
|
||||
RefPtr<MediaDataDecoder::InitPromise>
|
||||
|
Loading…
Reference in New Issue
Block a user