Fixed bug: avoid using object's data/methods when a window is hidden in closeEvent() notification.

git-svn-id: http://yate.null.ro/svn/yate/trunk@2265 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
marian 2008-10-17 15:27:58 +00:00
parent ebaa74e0c0
commit 9d0e63dfb9
1 changed files with 5 additions and 2 deletions

View File

@ -1474,10 +1474,13 @@ bool QtWindow::getProperty(const String& name, const String& item, String& value
void QtWindow::closeEvent(QCloseEvent* event)
{
hide();
// NOTE: Don't access window's data after calling hide():
// some logics might destroy the window when hidden
QWidget::closeEvent(event);
if (m_mainWindow && Client::self())
Client::self()->quit();
QWidget::closeEvent(event);
else
hide();
}
void QtWindow::action()