Fix crash when quitting with floating levelstrip
This commit is contained in:
parent
e70e7ead32
commit
0f1e0ff430
4 changed files with 22 additions and 14 deletions
|
@ -486,25 +486,27 @@ void FilmstripFrames::hideEvent(QHideEvent *) {
|
|||
// active viewer change
|
||||
disconnect(app, SIGNAL(activeViewerChanged()), this, SLOT(getViewer()));
|
||||
|
||||
// if the level strip is floating during shutting down Tahoma2D
|
||||
// it can cause a crash disconnecting from the viewer which was already
|
||||
// destroyed.
|
||||
if (m_viewer && m_viewer->isValid()) {
|
||||
disconnectViewer();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void FilmstripFrames::disconnectViewer() {
|
||||
if (!m_viewer) return;
|
||||
|
||||
disconnect(m_viewer, SIGNAL(onZoomChanged()), this, SLOT(update()));
|
||||
disconnect(m_viewer, SIGNAL(refreshNavi()), this, SLOT(update()));
|
||||
disconnect(m_viewer, SIGNAL(viewerDestructing()), this,
|
||||
SLOT(disconnectViewer()));
|
||||
m_viewer = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void FilmstripFrames::getViewer() {
|
||||
bool viewerChanged = false;
|
||||
if (m_viewer != TApp::instance()->getActiveViewer()) {
|
||||
if (m_viewer) {
|
||||
disconnect(m_viewer, SIGNAL(onZoomChanged()), this, SLOT(update()));
|
||||
disconnect(m_viewer, SIGNAL(refreshNavi()), this, SLOT(update()));
|
||||
}
|
||||
disconnectViewer();
|
||||
viewerChanged = true;
|
||||
}
|
||||
|
||||
|
@ -513,6 +515,8 @@ void FilmstripFrames::getViewer() {
|
|||
if (m_viewer && viewerChanged) {
|
||||
connect(m_viewer, SIGNAL(onZoomChanged()), this, SLOT(update()));
|
||||
connect(m_viewer, SIGNAL(refreshNavi()), this, SLOT(update()));
|
||||
connect(m_viewer, SIGNAL(viewerDestructing()), this,
|
||||
SLOT(disconnectViewer()));
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -172,6 +172,7 @@ protected slots:
|
|||
void comboBoxToggled(bool);
|
||||
void navigatorToggled(bool);
|
||||
void levelSelected(int);
|
||||
void disconnectViewer();
|
||||
|
||||
private:
|
||||
// QSS Properties
|
||||
|
|
|
@ -852,6 +852,8 @@ SceneViewer::~SceneViewer() {
|
|||
|
||||
int ret = l_contexts.erase(m_currentContext);
|
||||
if (ret) TGLDisplayListsManager::instance()->releaseContext(m_currentContext);
|
||||
|
||||
emit viewerDestructing();
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
|
|
|
@ -498,6 +498,7 @@ signals:
|
|||
void refreshNavi();
|
||||
// for updating the titlebar
|
||||
void previewToggled();
|
||||
void viewerDestructing();
|
||||
};
|
||||
|
||||
// Functions
|
||||
|
|
Loading…
Reference in a new issue