Bug 1455328 - handle repeated calls to ContentParent::AllocPPrintingParent more gracefully; r?bobowen
MozReview-Commit-ID: FPl7zr7imPC
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -3344,18 +3344,20 @@ ContentParent::DeallocPNeckoParent(PNeck
delete necko;
return true;
}
PPrintingParent*
ContentParent::AllocPPrintingParent()
{
#ifdef NS_PRINTING
- MOZ_RELEASE_ASSERT(!mPrintingParent,
- "Only one PrintingParent should be created per process.");
+ if (mPrintingParent) {
+ // Only one PrintingParent should be created per process.
+ return nullptr;
+ }
// Create the printing singleton for this process.
mPrintingParent = new PrintingParent();
// Take another reference for IPDL code.
mPrintingParent.get()->AddRef();
return mPrintingParent.get();