зеркало из https://github.com/mozilla/gecko-dev.git
Add code to nullify pointers and do extra checks to catch docshell crashes most likely caused by bad weak references. b=67721 r=rpotts@netscape.com sr=mscott@netscape.com
This commit is contained in:
Родитель
6f72f9fad0
Коммит
a2785c5d51
|
@ -46,6 +46,7 @@ nsDSURIContentListener::Init()
|
|||
{
|
||||
nsresult rv = NS_OK;
|
||||
mCatMgr = do_GetService(NS_CATEGORYMANAGER_CONTRACTID, &rv);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
@ -111,6 +112,7 @@ nsDSURIContentListener::DoContent(const char* aContentType,
|
|||
|
||||
if (loadFlags & nsIChannel::LOAD_RETARGETED_DOCUMENT_URI) {
|
||||
nsCOMPtr<nsIDOMWindowInternal> domWindow = do_GetInterface(NS_STATIC_CAST(nsIDocShell*, mDocShell));
|
||||
NS_ENSURE_TRUE(domWindow, NS_ERROR_FAILURE);
|
||||
domWindow->Focus();
|
||||
}
|
||||
|
||||
|
@ -162,7 +164,7 @@ nsDSURIContentListener::CanHandleContent(const char* aContentType,
|
|||
|
||||
*aCanHandleContent = PR_FALSE;
|
||||
|
||||
if (aContentType)
|
||||
if (aContentType && mCatMgr)
|
||||
{
|
||||
nsXPIDLCString value;
|
||||
rv = mCatMgr->GetCategoryEntry("Gecko-Content-Viewers",
|
||||
|
|
|
@ -2506,6 +2506,7 @@ nsDocShell::Destroy()
|
|||
|
||||
if (mContentListener) {
|
||||
mContentListener->DocShell(nsnull);
|
||||
mContentListener->SetParentContentListener(nsnull);
|
||||
NS_RELEASE(mContentListener);
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче