Fix crash when duplicating maps

This commit is contained in:
GriffinR 2025-02-12 15:54:32 -05:00
parent ee986b8e56
commit 8f5880f5bd

View File

@ -35,13 +35,8 @@ Map::Map(const Map &other, QObject *parent) : Map(parent) {
// Copy events
for (auto i = other.m_events.constBegin(); i != other.m_events.constEnd(); i++) {
QList<Event*> newEvents;
for (const auto &event : i.value()) {
auto newEvent = event->duplicate();
m_ownedEvents.insert(newEvent);
newEvents.append(newEvent);
}
m_events[i.key()] = newEvents;
for (const auto &event : i.value())
addEvent(event->duplicate());
}
// Duplicating the map connections is probably not desirable, so we skip them.