mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 22:01:30 +00:00
Bug 1257616: We can release Conduits immediately if we're on MainThread already r=drno
This commit is contained in:
parent
cd9bdd29d1
commit
9865e1f013
@ -662,6 +662,7 @@ void
|
||||
AudioCallbackDriver::Destroy()
|
||||
{
|
||||
STREAM_LOG(LogLevel::Debug, ("AudioCallbackDriver destroyed."));
|
||||
mAudioInput = nullptr;
|
||||
mAudioStream.reset();
|
||||
}
|
||||
|
||||
|
@ -463,12 +463,16 @@ public:
|
||||
|
||||
~PipelineListener()
|
||||
{
|
||||
// release conduit on mainthread. Must use forget()!
|
||||
nsresult rv = NS_DispatchToMainThread(new
|
||||
ConduitDeleteEvent(conduit_.forget()));
|
||||
MOZ_ASSERT(!NS_FAILED(rv),"Could not dispatch conduit shutdown to main");
|
||||
if (NS_FAILED(rv)) {
|
||||
MOZ_CRASH();
|
||||
if (!NS_IsMainThread()) {
|
||||
// release conduit on mainthread. Must use forget()!
|
||||
nsresult rv = NS_DispatchToMainThread(new
|
||||
ConduitDeleteEvent(conduit_.forget()));
|
||||
MOZ_ASSERT(!NS_FAILED(rv),"Could not dispatch conduit shutdown to main");
|
||||
if (NS_FAILED(rv)) {
|
||||
MOZ_CRASH();
|
||||
}
|
||||
} else {
|
||||
conduit_ = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@ -625,12 +629,16 @@ class MediaPipelineReceiveAudio : public MediaPipelineReceive {
|
||||
|
||||
~PipelineListener()
|
||||
{
|
||||
// release conduit on mainthread. Must use forget()!
|
||||
nsresult rv = NS_DispatchToMainThread(new
|
||||
ConduitDeleteEvent(conduit_.forget()));
|
||||
MOZ_ASSERT(!NS_FAILED(rv),"Could not dispatch conduit shutdown to main");
|
||||
if (NS_FAILED(rv)) {
|
||||
MOZ_CRASH();
|
||||
if (!NS_IsMainThread()) {
|
||||
// release conduit on mainthread. Must use forget()!
|
||||
nsresult rv = NS_DispatchToMainThread(new
|
||||
ConduitDeleteEvent(conduit_.forget()));
|
||||
MOZ_ASSERT(!NS_FAILED(rv),"Could not dispatch conduit shutdown to main");
|
||||
if (NS_FAILED(rv)) {
|
||||
MOZ_CRASH();
|
||||
}
|
||||
} else {
|
||||
conduit_ = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user