Maybe fix possible race condition
This commit is contained in:
parent
7621dc8dd4
commit
7f70d98bb4
@ -533,7 +533,8 @@ public:
|
|||||||
std::vector< std::shared_ptr< RenderObject > > getObjects(const std::unordered_set< int > &objectIDs) {
|
std::vector< std::shared_ptr< RenderObject > > getObjects(const std::unordered_set< int > &objectIDs) {
|
||||||
std::vector< std::shared_ptr< RenderObject > > ret{};
|
std::vector< std::shared_ptr< RenderObject > > ret{};
|
||||||
for ( const auto &x : render_objects ) {
|
for ( const auto &x : render_objects ) {
|
||||||
if ( objectIDs.find( x->getId() ) != objectIDs.end() ) {
|
// check if object exists because of possible race condition
|
||||||
|
if ( x && objectIDs.find( x->getId() ) != objectIDs.end() ) {
|
||||||
ret.push_back( x );
|
ret.push_back( x );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user