Skip to content

Commit

Permalink
[mesh] Add an angry comment, fix memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Dec 10, 2019
1 parent 7381a25 commit ce5841c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/analysis/mesh/qgsmeshcalcutils.cpp
Expand Up @@ -24,6 +24,7 @@
#include "qgstriangularmesh.h"
#include "qgsmapsettings.h"
#include "qgsmeshlayerutils.h"
#include "qgsmeshlayerrenderer.h"

const double D_TRUE = 1.0;
const double D_FALSE = 0.0;
Expand Down Expand Up @@ -696,6 +697,9 @@ void QgsMeshCalcUtils::updateMesh() const
{
if ( ! mMeshLayer->nativeMesh() )
{
// THIS code is very confusing -- someone please add some explanation as to why a map renderer is created here! (Or better,
// add explicit members to do whatever it is that's actually wanted here, instead of creating the map renderer)

// we do not care about triangles,
// we just want transformed coordinates
// of the native mesh. So create
Expand All @@ -705,7 +709,8 @@ void QgsMeshCalcUtils::updateMesh() const
mapSettings.setDestinationCrs( mMeshLayer->crs() );
mapSettings.setOutputDpi( 96 );
QgsRenderContext context = QgsRenderContext::fromMapSettings( mapSettings );
mMeshLayer->createMapRenderer( context );

delete mMeshLayer->createMapRenderer( context );
}
}

Expand Down

0 comments on commit ce5841c

Please sign in to comment.