Skip to content

Commit

Permalink
src/3d: tag false positive cppcheck memleak errors
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault authored and nyalldawson committed Jun 15, 2020
1 parent b32bdb2 commit ef8d0dc
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/3d/qgs3dmapscene.cpp
Expand Up @@ -162,6 +162,9 @@ Qgs3DMapScene::Qgs3DMapScene( const Qgs3DMapSettings &map, QgsAbstract3DEngine *
// it _somehow_ works even when frustum culling is enabled with some camera positions,
// but then when zoomed in more it would disappear - so let's keep frustum culling disabled
mEngine->setFrustumCullingEnabled( false );

// cppcheck wrongly believes skyBox will leak
// cppcheck-suppress memleak
}

// force initial update of chunked entities
Expand Down
3 changes: 3 additions & 0 deletions src/3d/symbols/qgsline3dsymbol_p.cpp
Expand Up @@ -196,6 +196,9 @@ void QgsBufferedLine3DSymbolHandler::makeEntity( Qt3DCore::QEntity *parent, cons

if ( !selected )
entity->findChild<Qt3DRender::QGeometryRenderer *>()->setObjectName( QStringLiteral( "main" ) ); // temporary measure to distinguish between "selected" and "main"

// cppcheck wrongly believes entity will leak
// cppcheck-suppress memleak
}


Expand Down
12 changes: 12 additions & 0 deletions src/3d/symbols/qgspoint3dsymbol_p.cpp
Expand Up @@ -148,6 +148,9 @@ void QgsInstancedPoint3DSymbolHandler::makeEntity( Qt3DCore::QEntity *parent, co
entity->addComponent( renderer( mSymbol, out.positions ) );
entity->addComponent( mat );
entity->setParent( parent );

// cppcheck wrongly believes entity will leak
// cppcheck-suppress memleak
}


Expand Down Expand Up @@ -446,6 +449,9 @@ void QgsModelPoint3DSymbolHandler::addSceneEntities( const Qgs3DMapSettings &map
entity->addComponent( modelLoader );
entity->addComponent( transform( position, symbol ) );
entity->setParent( parent );

// cppcheck wrongly believes entity will leak
// cppcheck-suppress memleak
}
}

Expand Down Expand Up @@ -474,6 +480,9 @@ void QgsModelPoint3DSymbolHandler::addMeshEntities( const Qgs3DMapSettings &map,
entity->addComponent( mat );
entity->addComponent( transform( position, symbol ) );
entity->setParent( parent );

// cppcheck wrongly believes entity will leak
// cppcheck-suppress memleak
}
}

Expand Down Expand Up @@ -586,6 +595,9 @@ void QgsPoint3DBillboardSymbolHandler::makeEntity( Qt3DCore::QEntity *parent, co
entity->addComponent( billboardTransform );
entity->addComponent( billboardGeometryRenderer );
entity->setParent( parent );

// cppcheck wrongly believes entity will leak
// cppcheck-suppress memleak
}


Expand Down
2 changes: 2 additions & 0 deletions src/3d/symbols/qgspolygon3dsymbol_p.cpp
Expand Up @@ -247,6 +247,8 @@ void QgsPolygon3DSymbolHandler::makeEntity( Qt3DCore::QEntity *parent, const Qgs

if ( !selected )
entity->findChild<Qt3DRender::QGeometryRenderer *>()->setObjectName( QStringLiteral( "main" ) ); // temporary measure to distinguish between "selected" and "main"
// cppcheck wrongly believes entity will leak
// cppcheck-suppress memleak
}


Expand Down

0 comments on commit ef8d0dc

Please sign in to comment.