Skip to content
Permalink
Browse files
Fix memory leak
  • Loading branch information
elpaso committed Jul 6, 2021
1 parent 9bd7f0b commit c131c8115ffb0f41ac6d7637c6e59dd3fb794722
Showing with 2 additions and 3 deletions.
  1. +2 −3 src/app/browser/qgsinbuiltdataitemproviders.cpp
@@ -1063,11 +1063,10 @@ void QgsDatabaseItemGuiProvider::populateContextMenu( QgsDataItem *item, QMenu *
}

// SQL dialog
if ( item->databaseConnection() )
if ( std::unique_ptr<QgsAbstractDatabaseProviderConnection> conn( item->databaseConnection() ); conn )
{
std::unique_ptr<QgsAbstractDatabaseProviderConnection> conn( item->databaseConnection() );

if ( conn && conn->capabilities().testFlag( QgsAbstractDatabaseProviderConnection::Capability::ExecuteSql ) )
if ( conn->capabilities().testFlag( QgsAbstractDatabaseProviderConnection::Capability::ExecuteSql ) )
{

QAction *sqlAction = new QAction( QObject::tr( "Run SQL command…" ), menu );

0 comments on commit c131c81

Please sign in to comment.