Fix potential race condition.

Found when I noticed that the unit tests segfaulted every once in a while.

Test: Ran all unit tests 1000 times. The crash usually happens before 100 runs.
Change-Id: I1c8d2e3637400dc80f273f3677f4c94b0dbeac9d
This commit is contained in:
Christopher Ferris 2019-06-19 18:41:37 -07:00
parent 4a8d436ad1
commit d1d973be12

View file

@ -300,7 +300,7 @@ MapInfo::~MapInfo() {
std::string MapInfo::GetBuildID() {
uintptr_t id = build_id.load();
if (build_id != 0) {
if (id != 0) {
return *reinterpret_cast<std::string*>(id);
}