Skip to content

Commit

Permalink
- Fix crash when we hit QgsChunkedEntity::mMaxLoadedChunks limit
Browse files Browse the repository at this point in the history
- The reason is that it might happen that some tiles and queued for load and
didn't have their entities created yet and we might enable/disable these entities.
- The bug will be triggered if the point cloud nodes hierarchy is deep enough or
the replacement queue size is made to be small enough
  • Loading branch information
NEDJIMAbelgacem authored and nyalldawson committed Jan 31, 2022
1 parent b96fb90 commit 22c816c
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/3d/chunks/qgschunkedentity_p.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,16 +153,22 @@ void QgsChunkedEntity::update( const SceneState &state )
}
else
{
node->entity()->setEnabled( true );
++enabled;
if ( Qt3DCore::QEntity *entity = node->entity() )
{
entity->setEnabled( true );
++enabled;
}
}
}

// disable those that were active but will not be anymore
for ( QgsChunkNode *node : activeBefore )
{
node->entity()->setEnabled( false );
++disabled;
if ( Qt3DCore::QEntity *entity = node->entity() )
{
entity->setEnabled( false );
++disabled;
}
}

// unload those that are over the limit for replacement
Expand Down

0 comments on commit 22c816c

Please sign in to comment.