Skip to content
Permalink
Browse files

Fix processing Execute SQL algorithms steal ownership of database pro…

…viders

Fixes #36641
  • Loading branch information
nyalldawson committed May 22, 2020
1 parent 25e24e7 commit 288ba2e80e13c998e4ade6825dc324aa60ccc104
@@ -72,7 +72,7 @@ QVariantMap QgsExecutePostgisQueryAlgorithm::processAlgorithm( const QVariantMap
std::unique_ptr<QgsAbstractDatabaseProviderConnection> conn;
try
{
std::unique_ptr<QgsProviderMetadata> md( QgsProviderRegistry::instance()->providerMetadata( QStringLiteral( "postgres" ) ) );
QgsProviderMetadata *md = QgsProviderRegistry::instance()->providerMetadata( QStringLiteral( "postgres" ) );
conn.reset( static_cast<QgsAbstractDatabaseProviderConnection *>( md->createConnection( connName ) ) );
}
catch ( QgsProviderConnectionException & )
@@ -83,7 +83,7 @@ QVariantMap QgsExecuteSpatialiteQueryAlgorithm::processAlgorithm( const QVariant
std::unique_ptr<QgsAbstractDatabaseProviderConnection> conn;
try
{
std::unique_ptr<QgsProviderMetadata> md( QgsProviderRegistry::instance()->providerMetadata( QStringLiteral( "spatialite" ) ) );
QgsProviderMetadata *md = QgsProviderRegistry::instance()->providerMetadata( QStringLiteral( "spatialite" ) );
conn.reset( static_cast<QgsAbstractDatabaseProviderConnection *>( md->createConnection( uri.uri(), QVariantMap() ) ) );
}
catch ( QgsProviderConnectionException & )
@@ -72,7 +72,7 @@ QVariantMap QgsExecuteRegisteredSpatialiteQueryAlgorithm::processAlgorithm( cons
std::unique_ptr<QgsAbstractDatabaseProviderConnection> conn;
try
{
std::unique_ptr<QgsProviderMetadata> md( QgsProviderRegistry::instance()->providerMetadata( QStringLiteral( "spatialite" ) ) );
QgsProviderMetadata *md = QgsProviderRegistry::instance()->providerMetadata( QStringLiteral( "spatialite" ) );
conn.reset( static_cast<QgsAbstractDatabaseProviderConnection *>( md->createConnection( connName ) ) );
}
catch ( QgsProviderConnectionException & )

0 comments on commit 288ba2e

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