Bug 1002527 - Fix not to initialize remote browser's ContentParent twice. r=bent

ContentParent::GetNewOrUsed() initialize the ContentParent always, even it is an
initialized one from PreallocatedProcessManager::Take(). Initialize twice makes
ContentParent to receive two the same observed event, and creates leak in both
observer list and itself.
This commit is contained in:
Ting-Yu Chou 2014-04-30 02:00:00 -04:00
parent 34490cb6be
commit c4938d1cf0

View File

@ -598,9 +598,9 @@ ContentParent::GetNewOrUsed(bool aForBrowserElement)
aForBrowserElement, aForBrowserElement,
/* isForPreallocated = */ false, /* isForPreallocated = */ false,
PROCESS_PRIORITY_FOREGROUND); PROCESS_PRIORITY_FOREGROUND);
p->Init();
} }
p->Init();
sNonAppContentParents->AppendElement(p); sNonAppContentParents->AppendElement(p);
return p.forget(); return p.forget();
} }