Skip to content

Commit

Permalink
Fix crash when duplicating maps
Browse files Browse the repository at this point in the history
  • Loading branch information
GriffinRichards committed Feb 12, 2025
1 parent ee986b8 commit 8f5880f
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/core/map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 8f5880f

Please sign in to comment.