fix a crash that could happen if a child import met with an error (eg failed to

open a channel).  Bug 186606, r=sicking, sr=peterv


git-svn-id: svn://10.0.0.236/trunk@135919 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bzbarsky%mit.edu
2003-01-07 01:13:07 +00:00
parent 0c1d5a1bc2
commit 6f77aecc51
2 changed files with 12 additions and 4 deletions

View File

@@ -1790,10 +1790,14 @@ CSSLoaderImpl::SheetComplete(SheetLoadData* aLoadData, PRBool aSucceeded)
data->mParentData->mPendingChildren != 0,
"Broken pending child count on our parent");
// If we have a parent, our parent is no longer being parsed, and
// we are the last pending child, then our load completion
// completes the parent too. Note that the parent _can_ still be
// being parsed (eg if the child (us) failed to open the channel
// or some such).
if (data->mParentData &&
--(data->mParentData->mPendingChildren) == 0 &&
!data->mSyncLoad) {
// We finished the parent too
mParsingDatas.IndexOf(data->mParentData) == -1) {
SheetComplete(data->mParentData, aSucceeded);
}