0001023: Crash when quitting after using Windows > Tile

This commit is contained in:
wmayer 2013-07-06 17:21:35 +02:00
parent efa27db67a
commit 267c8ad046
3 changed files with 13 additions and 2 deletions

View File

@ -76,13 +76,17 @@ void MDIView::deleteSelf()
{
// When using QMdiArea make sure to remove the QMdiSubWindow
// this view is associated with.
//
// #0001023: Crash when quitting after using Windows > Tile
// Use deleteLater() instead of delete operator.
#if !defined (NO_USE_QT_MDI_AREA)
QWidget* parent = this->parentWidget();
if (qobject_cast<QMdiSubWindow*>(parent))
delete parent;
parent->deleteLater();
else
#endif
delete this;
this->deleteLater();
_pcDocument = 0;
}
void MDIView::setOverrideCursor(const QCursor& c)

View File

@ -179,6 +179,12 @@ View3DInventor::~View3DInventor()
delete _viewer;
}
void View3DInventor::deleteSelf()
{
_viewer->setDocument(0);
MDIView::deleteSelf();
}
PyObject *View3DInventor::getPyObject(void)
{
if (!_viewerPy)

View File

@ -73,6 +73,7 @@ public:
/// Mesage handler
virtual bool onMsg(const char* pMsg, const char** ppReturn);
virtual bool onHasMsg(const char* pMsg) const;
virtual void deleteSelf();
/// Observer message from the ParameterGrp
virtual void OnChange(ParameterGrp::SubjectType &rCaller,ParameterGrp::MessageType Reason);
/// get called when the document is updated