mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 15:23:51 +00:00
Bug 1157488 - Don't spin the event loop by synchronously dispatching when we're already on the main thread. r=jww
This was causing us to re-enter RunSyncSectionsInternal.
This commit is contained in:
parent
9d831360d9
commit
593c23f2d0
@ -421,7 +421,12 @@ already_AddRefed<AndroidMediaResourceServer>
|
||||
AndroidMediaResourceServer::Start()
|
||||
{
|
||||
nsRefPtr<AndroidMediaResourceServer> server = new AndroidMediaResourceServer();
|
||||
NS_DispatchToMainThread(server, NS_DISPATCH_SYNC);
|
||||
// We should fix this up - see bug 1157476.
|
||||
if (NS_IsMainThread()) {
|
||||
server->Run();
|
||||
} else {
|
||||
NS_DispatchToMainThread(server, NS_DISPATCH_SYNC);
|
||||
}
|
||||
return server.forget();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user