# HG changeset patch # User Teemu Piippo # Date 1410034888 -10800 # Node ID 82a9c3549db1b2fba30f1086b9a7e13a3a5d7535 # Parent 5dcd2e741d1c9de3fb470b9f7fbd5cd96f142808 - a more elegant fix to the problem addressed in the previous commit diff -r 5dcd2e741d1c -r 82a9c3549db1 src/ldDocument.cc --- a/src/ldDocument.cc Sat Sep 06 23:18:26 2014 +0300 +++ b/src/ldDocument.cc Sat Sep 06 23:21:28 2014 +0300 @@ -159,9 +159,6 @@ if (IsExiting()) return; - for (LDObjectPtr obj : m_objects) - obj->setSelected (false); - g_allDocuments.removeOne (self()); m_flags |= DOCF_IsBeingDestroyed; delete m_history; diff -r 5dcd2e741d1c -r 82a9c3549db1 src/ldObject.cc --- a/src/ldObject.cc Sat Sep 06 23:18:26 2014 +0300 +++ b/src/ldObject.cc Sat Sep 06 23:21:28 2014 +0300 @@ -308,7 +308,7 @@ return; // If this object was selected, unselect it now - if (isSelected()) + if (isSelected() and document() != null) deselect(); // If this object was associated to a file, remove it off it now