1
0
Fork 0

Add assertion for nullptr in ClusterComm::instance()

This commit is contained in:
Max Neunhoeffer 2017-02-08 11:07:12 +01:00
parent 0a31063a35
commit bc9cb47b5d
1 changed files with 6 additions and 0 deletions

View File

@ -277,6 +277,12 @@ std::shared_ptr<ClusterComm> ClusterComm::instance() {
}
}
}
// We want to achieve by other means that nobody requests a copy of the
// shared_ptr when the singleton is already destroyed. Therefore we put
// an assertion despite the fact that we have checks for nullptr in
// all places that call this method. Assertions have no effect in released
// code at the customer's site.
TRI_ASSERT(_theInstance != nullptr);
return _theInstance;
}