Skip to content

Commit ce5841c

Browse files
committedDec 10, 2019
[mesh] Add an angry comment, fix memory leak
1 parent 7381a25 commit ce5841c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed
 

‎src/analysis/mesh/qgsmeshcalcutils.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include "qgstriangularmesh.h"
2525
#include "qgsmapsettings.h"
2626
#include "qgsmeshlayerutils.h"
27+
#include "qgsmeshlayerrenderer.h"
2728

2829
const double D_TRUE = 1.0;
2930
const double D_FALSE = 0.0;
@@ -696,6 +697,9 @@ void QgsMeshCalcUtils::updateMesh() const
696697
{
697698
if ( ! mMeshLayer->nativeMesh() )
698699
{
700+
// THIS code is very confusing -- someone please add some explanation as to why a map renderer is created here! (Or better,
701+
// add explicit members to do whatever it is that's actually wanted here, instead of creating the map renderer)
702+
699703
// we do not care about triangles,
700704
// we just want transformed coordinates
701705
// of the native mesh. So create
@@ -705,7 +709,8 @@ void QgsMeshCalcUtils::updateMesh() const
705709
mapSettings.setDestinationCrs( mMeshLayer->crs() );
706710
mapSettings.setOutputDpi( 96 );
707711
QgsRenderContext context = QgsRenderContext::fromMapSettings( mapSettings );
708-
mMeshLayer->createMapRenderer( context );
712+
713+
delete mMeshLayer->createMapRenderer( context );
709714
}
710715
}
711716

0 commit comments

Comments
 (0)
Please sign in to comment.