mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 05:11:16 +00:00
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:
parent
ced7192e2f
commit
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)
|
||||
|
Loading…
Reference in New Issue
Block a user