Code

Fix access to removed elements of a map in document-subset.cpp
authorKrzysztof Kosiński <tweenk.pl@gmail.com>
Thu, 4 Feb 2010 02:39:19 +0000 (03:39 +0100)
committerKrzysztof Kosiński <tweenk.pl@gmail.com>
Thu, 4 Feb 2010 02:39:19 +0000 (03:39 +0100)
src/document-subset.cpp

index aa4046d864605f112fdbdb157281cd3548bab46c..eb7265b2d269171bdb3f4c4b027f3c44033ac088 100644 (file)
@@ -184,9 +184,6 @@ private:
 
     void _doRemove(SPObject *obj) {
         Record &record=records[obj];
-        record.release_connection.disconnect();
-        record.position_changed_connection.disconnect();
-        records.erase(obj);
 
         if ( record.parent == NULL ) {
             Record &root = records[NULL];
@@ -198,6 +195,9 @@ private:
             }
         }
 
+        record.release_connection.disconnect();
+        record.position_changed_connection.disconnect();
+        records.erase(obj);
         removed_signal.emit(obj);
         sp_object_unref(obj);
     }