src/model.cpp

changeset 159
1a04364d20b5
parent 158
5bd755eaa5a8
child 173
8a3047468994
--- a/src/model.cpp	Sat Mar 05 12:42:14 2022 +0200
+++ b/src/model.cpp	Sat Mar 05 12:47:10 2022 +0200
@@ -158,8 +158,9 @@
 	Q_EMIT this->beginInsertRows({}, position, position);
 	this->body.push_back(std::move(object));
 	Q_EMIT this->endInsertRows();
-	this->objectsById[object->id] = object.get();
-	return object->id;
+	const ldraw::id_t id = this->body.back()->id;
+	this->objectsById[id] = this->body.back().get();
+	return id;
 }
 
 /**

mercurial