mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 22:32:46 +00:00
Bug 119310 preferences + open in new tab + clicking browser crashes @nsLoadGroup::RemoveRequest
assert instead of crashing if some load fails r=darin sr=waterson
This commit is contained in:
parent
4ca475a6d9
commit
7edbfb6b60
@ -5950,16 +5950,18 @@ nsXULDocument::ResumeWalk()
|
||||
nsIDocumentObserver* observer = (nsIDocumentObserver*) mObservers[i];
|
||||
observer->EndLoad(this);
|
||||
}
|
||||
NS_ASSERTION(mPlaceHolderRequest, "Bug 119310, perhaps overlayinfo referenced a overlay that doesn't exist");
|
||||
if (mPlaceHolderRequest) {
|
||||
// Remove the placeholder channel; if we're the last channel in the
|
||||
// load group, this will fire the OnEndDocumentLoad() method in the
|
||||
// docshell, and run the onload handlers, etc.
|
||||
nsCOMPtr<nsILoadGroup> group = do_QueryReferent(mDocumentLoadGroup);
|
||||
if (group) {
|
||||
rv = group->RemoveRequest(mPlaceHolderRequest, nsnull, NS_OK);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
// Remove the placeholder channel; if we're the last channel in the
|
||||
// load group, this will fire the OnEndDocumentLoad() method in the
|
||||
// docshell, and run the onload handlers, etc.
|
||||
nsCOMPtr<nsILoadGroup> group = do_QueryReferent(mDocumentLoadGroup);
|
||||
if (group) {
|
||||
rv = group->RemoveRequest(mPlaceHolderRequest, nsnull, NS_OK);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
mPlaceHolderRequest = nsnull;
|
||||
mPlaceHolderRequest = nsnull;
|
||||
}
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
@ -1380,9 +1380,9 @@ nsresult nsParser::DidBuildModel(nsresult anErrorCode) {
|
||||
nsresult result=anErrorCode;
|
||||
|
||||
if (IsComplete()) {
|
||||
if(mParserContext && !mParserContext->mPrevContext) {
|
||||
if (mParserContext && !mParserContext->mPrevContext) {
|
||||
if (mParserContext->mDTD) {
|
||||
result = mParserContext->mDTD->DidBuildModel(anErrorCode,PRBool(0==mParserContext->mPrevContext),this,mSink);
|
||||
result = mParserContext->mDTD->DidBuildModel(anErrorCode,PR_TRUE,this,mSink);
|
||||
}
|
||||
//Ref. to bug 61462.
|
||||
mParserContext->mRequest = 0;
|
||||
|
@ -482,6 +482,7 @@ nsLoadGroup::AddRequest(nsIRequest *request, nsISupports* ctxt)
|
||||
NS_IMETHODIMP
|
||||
nsLoadGroup::RemoveRequest(nsIRequest *request, nsISupports* ctxt, nsresult aStatus)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(request);
|
||||
nsresult rv;
|
||||
|
||||
#if defined(PR_LOGGING)
|
||||
|
@ -1380,9 +1380,9 @@ nsresult nsParser::DidBuildModel(nsresult anErrorCode) {
|
||||
nsresult result=anErrorCode;
|
||||
|
||||
if (IsComplete()) {
|
||||
if(mParserContext && !mParserContext->mPrevContext) {
|
||||
if (mParserContext && !mParserContext->mPrevContext) {
|
||||
if (mParserContext->mDTD) {
|
||||
result = mParserContext->mDTD->DidBuildModel(anErrorCode,PRBool(0==mParserContext->mPrevContext),this,mSink);
|
||||
result = mParserContext->mDTD->DidBuildModel(anErrorCode,PR_TRUE,this,mSink);
|
||||
}
|
||||
//Ref. to bug 61462.
|
||||
mParserContext->mRequest = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user