Make sure not to access members of deleted SheetLoadDatas. Bug 308766, r+sr=jst

This commit is contained in:
bzbarsky%mit.edu 2005-09-16 15:38:04 +00:00
parent 71c092caac
commit b8cf83ad82

View File

@ -1831,12 +1831,16 @@ CSSLoaderImpl::LoadChildSheet(nsICSSStyleSheet* aParentSheet,
}
NS_ADDREF(data);
PRBool syncLoad = data->mSyncLoad;
// Load completion will release the data
rv = LoadSheet(data, state);
NS_ENSURE_SUCCESS(rv, rv);
data->mMustNotify = PR_TRUE;
// If syncLoad is true, |data| will be deleted by now.
if (!syncLoad) {
data->mMustNotify = PR_TRUE;
}
return rv;
}