Bug 485579. Fix possible crash when closing tabs using cairo-qt. r=vlad, a=beltzner

This commit is contained in:
Tobias Hunger 2009-03-27 12:35:27 +01:00
parent 080b6bec9f
commit ec1bc87655
4 changed files with 19 additions and 0 deletions

View File

@ -10,6 +10,12 @@ MozQWidget::MozQWidget(nsWindow *receiver, QWidget *parent,
setAttribute(Qt::WA_QuitOnClose, false);
}
MozQWidget::~MozQWidget()
{
if (mReceiver)
mReceiver->QWidgetDestroyed();
}
bool MozQWidget::event(QEvent *e)
{
nsEventStatus status = nsEventStatus_eIgnore;

View File

@ -14,6 +14,8 @@ public:
MozQWidget(nsWindow* receiver, QWidget *parent,
const char *name, int f);
~MozQWidget();
/**
* Mozilla helper.
*/

View File

@ -109,6 +109,8 @@
#include "qx11info_x11.h"
#endif
#include <QtCore/QDebug>
#include <execinfo.h>
#include "mozqwidget.h"
@ -316,6 +318,7 @@ nsWindow::Destroy(void)
mMozQWidget->deleteLater();
}
mMozQWidget = nsnull;
mDrawingArea = nsnull;
OnDestroy();
@ -1968,6 +1971,12 @@ nsWindow::ConvertBorderStyles(nsBorderStyle aStyle)
return w;
}
void nsWindow::QWidgetDestroyed()
{
mDrawingArea = nsnull;
mMozQWidget = nsnull;
}
NS_IMETHODIMP
nsWindow::MakeFullScreen(PRBool aFullScreen)
{

View File

@ -208,6 +208,8 @@ public:
void LoseFocus();
qint32 ConvertBorderStyles(nsBorderStyle aStyle);
void QWidgetDestroyed();
/***** from CommonWidget *****/