Skip to content

Commit

Permalink
Move insertion into parts vector to end of lambda to avoid dereferenc…
Browse files Browse the repository at this point in the history
…ing real_mount after it has been invalidated.
  • Loading branch information
kevingranade committed Jun 2, 2022
1 parent c840e67 commit 62fd404
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/vehicle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5894,9 +5894,9 @@ void vehicle::refresh( const bool remove_fakes )
int fake_index = parts.size();
part_real.fake_part_at = fake_index;
fake_parts.push_back( fake_index );
parts.push_back( part_fake );
relative_parts[ part_fake.mount ].push_back( fake_index );
edges.emplace( real_mount, edge_info );
parts.push_back( part_fake );
}
};
// re-install fake parts - this could be done in a separate function, but we want to
Expand Down

0 comments on commit 62fd404

Please sign in to comment.