зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1476729 - Wrap object in RefPtr. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D2243 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
ced7192e2f
Коммит
1b724d418f
|
@ -102,7 +102,7 @@ SharedThreadPool::Get(const nsCString& aName, uint32_t aThreadLimit)
|
|||
{
|
||||
MOZ_ASSERT(sMonitor && sPools);
|
||||
ReentrantMonitorAutoEnter mon(*sMonitor);
|
||||
SharedThreadPool* pool = nullptr;
|
||||
RefPtr<SharedThreadPool> pool;
|
||||
nsresult rv;
|
||||
|
||||
if (auto entry = sPools->LookupForAdd(aName)) {
|
||||
|
@ -135,12 +135,10 @@ SharedThreadPool::Get(const nsCString& aName, uint32_t aThreadLimit)
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
entry.OrInsert([pool] () { return pool; });
|
||||
entry.OrInsert([pool] () { return pool.get(); });
|
||||
}
|
||||
|
||||
MOZ_ASSERT(pool);
|
||||
RefPtr<SharedThreadPool> instance(pool);
|
||||
return instance.forget();
|
||||
return pool.forget();
|
||||
}
|
||||
|
||||
NS_IMETHODIMP_(MozExternalRefCountType) SharedThreadPool::AddRef(void)
|
||||
|
|
Загрузка…
Ссылка в новой задаче