зеркало из https://github.com/mozilla/pjs.git
Bug 589297 - nsWindow::GetViewWidget crashes when can't find view. r=romaxa a=npodb
This commit is contained in:
Родитель
778ca7d600
Коммит
12d185c6e2
|
@ -674,7 +674,7 @@ nsWindow::Update()
|
|||
QWidget* nsWindow::GetViewWidget()
|
||||
{
|
||||
NS_ASSERTION(mWidget, "Calling GetViewWidget without mWidget created");
|
||||
if (!mWidget || !mWidget->scene())
|
||||
if (!mWidget || !mWidget->scene() || !mWidget->scene()->views().size())
|
||||
return nsnull;
|
||||
|
||||
NS_ASSERTION(mWidget->scene()->views().size() == 1, "Not exactly one view for our scene!");
|
||||
|
@ -1739,8 +1739,11 @@ nsWindow::NativeResize(PRInt32 aWidth, PRInt32 aHeight, PRBool aRepaint)
|
|||
mNeedsResize = PR_FALSE;
|
||||
|
||||
#ifndef MOZ_ENABLE_MEEGOTOUCH
|
||||
if (mIsTopLevel && XRE_GetProcessType() == GeckoProcessType_Default)
|
||||
GetViewWidget()->resize(aWidth, aHeight);
|
||||
if (mIsTopLevel && XRE_GetProcessType() == GeckoProcessType_Default) {
|
||||
QWidget *widget = GetViewWidget();
|
||||
NS_ENSURE_TRUE(widget,);
|
||||
widget->resize(aWidth, aHeight);
|
||||
}
|
||||
#endif
|
||||
|
||||
mWidget->resize( aWidth, aHeight);
|
||||
|
@ -1762,8 +1765,11 @@ nsWindow::NativeResize(PRInt32 aX, PRInt32 aY,
|
|||
|
||||
#ifndef MOZ_ENABLE_MEEGOTOUCH
|
||||
if (mIsTopLevel) {
|
||||
if (XRE_GetProcessType() == GeckoProcessType_Default)
|
||||
GetViewWidget()->setGeometry(aX, aY, aWidth, aHeight);
|
||||
if (XRE_GetProcessType() == GeckoProcessType_Default) {
|
||||
QWidget *widget = GetViewWidget();
|
||||
NS_ENSURE_TRUE(widget,);
|
||||
widget->setGeometry(aX, aY, aWidth, aHeight);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче