Skip to content

Commit

Permalink
Tiled scene chunk loader: clean up when deleted while doing work
Browse files Browse the repository at this point in the history
  • Loading branch information
wonder-sk committed Aug 11, 2023
1 parent fe941e3 commit c6a8e94
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/3d/qgstiledscenechunkloader_p.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,16 @@ QgsTiledSceneChunkLoader::QgsTiledSceneChunkLoader( QgsChunkNode *node, const Qg
mFutureWatcher->setFuture( future );
}

QgsTiledSceneChunkLoader::~QgsTiledSceneChunkLoader()
{
if ( !mFutureWatcher->isFinished() )
{
disconnect( mFutureWatcher, &QFutureWatcher<void>::finished, this, &QgsChunkQueueJob::finished );
mFutureWatcher->waitForFinished();
}
}


Qt3DCore::QEntity *QgsTiledSceneChunkLoader::createEntity( Qt3DCore::QEntity *parent )
{
if ( !mEntity )
Expand Down
2 changes: 2 additions & 0 deletions src/3d/qgstiledscenechunkloader_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ class QgsTiledSceneChunkLoader : public QgsChunkLoader
public:
QgsTiledSceneChunkLoader( QgsChunkNode *node, const QgsTiledSceneChunkLoaderFactory &factory, const QgsTiledSceneTile &t );

~QgsTiledSceneChunkLoader();

virtual Qt3DCore::QEntity *createEntity( Qt3DCore::QEntity *parent );

private:
Expand Down

0 comments on commit c6a8e94

Please sign in to comment.