Skip to content
Permalink
Browse files

Merge pull request #3181 from dmarteau/release-2_14

Clean up QgsExpressionContext in QgsServer::handleRequest
  • Loading branch information
rldhont committed Jun 7, 2016
2 parents 446daaa + 50181ee commit bb140317840daf7ddc6cc0f77b7a77f47676feff
Showing with 7 additions and 0 deletions.
  1. +7 −0 src/server/qgsserver.cpp
@@ -465,6 +465,13 @@ QPair<QByteArray, QByteArray> QgsServer::handleRequest( const QString& queryStri
int logLevel = QgsServerLogger::instance()->logLevel();
QTime time; //used for measuring request time if loglevel < 1
QgsMapLayerRegistry::instance()->removeAllMapLayers();

// Clean up Expression Context
// because each call to QgsMapLayer::draw add items to QgsExpressionContext scope
// list. This prevent the scope list to grow indefinitely and seriously deteriorate
// performances and memory in the long run
sMapRenderer->rendererContext()->setExpressionContext( QgsExpressionContext() );

sQgsApplication->processEvents();
if ( logLevel < 1 )
{

0 comments on commit bb14031

Please sign in to comment.
You can’t perform that action at this time.