diff main/MainWindow.cpp @ 760:5b4206f7d7d4

Remove model from pan layer when it's about to be deleted, fixing #1035
author Chris Cannam
date Wed, 13 Aug 2014 16:10:36 +0100
parents e2d2ac12577c
children 956134fa9f24
line wrap: on
line diff
--- a/main/MainWindow.cpp	Wed Aug 13 16:09:11 2014 +0100
+++ b/main/MainWindow.cpp	Wed Aug 13 16:10:36 2014 +0100
@@ -4147,6 +4147,19 @@
 }
 
 void
+MainWindow::modelAboutToBeDeleted(Model *model)
+{
+    if (model == m_panLayer->getModel()) {
+        if (model == getMainModel()) {
+            m_panLayer->setModel(0);
+        } else {
+            m_panLayer->setModel(getMainModel());
+        }
+    }
+    MainWindowBase::modelAboutToBeDeleted(model);
+}
+
+void
 MainWindow::setInstantsNumbering()
 {
     QAction *a = dynamic_cast<QAction *>(sender());