Skip to content
Permalink
Browse files

Clean up QgsExpressionContext in QgsServer::handleRequest

  • Loading branch information
dmarteau committed Jun 5, 2016
1 parent 882cd7b commit 50181eee00709e3f7e29b2b53282f28bdedfe265
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 50181ee

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