Skip to content
Permalink
Browse files

Fix leak in unit test

  • Loading branch information
nyalldawson committed Dec 12, 2017
1 parent c17d85f commit cda271f3883eb33b20a9fdc565455f6cae1cda2b
Showing with 2 additions and 3 deletions.
  1. +2 −3 tests/src/core/testqgsexpressioncontext.cpp
@@ -588,12 +588,11 @@ void TestQgsExpressionContext::globalScope()

//test removeGlobalVariables
QgsExpressionContextUtils::setGlobalVariable( QStringLiteral( "key" ), "value" );
QgsExpressionContextScope *globalScope3 = QgsExpressionContextUtils::globalScope();
std::unique_ptr< QgsExpressionContextScope > globalScope3( QgsExpressionContextUtils::globalScope() );
QVERIFY( globalScope3->hasVariable( "key" ) );
QgsExpressionContextUtils::removeGlobalVariable( QStringLiteral( "key" ) );
globalScope3 = QgsExpressionContextUtils::globalScope();
globalScope3.reset( QgsExpressionContextUtils::globalScope() );
QVERIFY( !globalScope3->hasVariable( "key" ) );
delete globalScope3;
}

void TestQgsExpressionContext::projectScope()

0 comments on commit cda271f

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