Skip to content

Commit

Permalink
Fix leak in unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Dec 12, 2017
1 parent c17d85f commit cda271f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tests/src/core/testqgsexpressioncontext.cpp
Expand Up @@ -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()
Expand Down

0 comments on commit cda271f

Please sign in to comment.