Change declaration order of maps used for vectors

If the destructor of an object tries to remove an entry from the map, there's no
guarantee it exists if the map has already been destroyed (because it was
declared after the vector of objects), resulting in a segfault. By declaring the
map first, we avoid this. Currently an issue for Nuclide, but potentially other
classes in the future.
This commit is contained in:
Paul Romano 2020-07-29 15:48:14 -05:00
parent 7c1371088d
commit 6992e53398
18 changed files with 22 additions and 22 deletions

View file

@ -80,8 +80,8 @@ void PropertyData::set_overlap(size_t y, size_t x) {
namespace model {
std::vector<Plot> plots;
std::unordered_map<int, int> plot_map;
std::vector<Plot> plots;
uint64_t plotter_seed = 1;
} // namespace model