mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-01 00:46:20 -05:00
delete not valid provider instances (fix memory leaks),
avoid failure due to assertion calling disconnectDb on PG provider more times
This commit is contained in:
parent
32920557b7
commit
cbf405f568
@ -400,6 +400,8 @@ QgsDataProvider *QgsProviderRegistry::provider( QString const & providerKey, QSt
|
||||
// necessarily a reflection on the data provider itself
|
||||
QgsDebugMsg( "Invalid data provider" );
|
||||
|
||||
delete dataProvider;
|
||||
|
||||
myLib->unload();
|
||||
delete myLib;
|
||||
return 0;
|
||||
|
@ -221,11 +221,13 @@ void QgsPostgresProvider::disconnectDb()
|
||||
if ( mConnectionRO )
|
||||
{
|
||||
mConnectionRO->disconnect();
|
||||
mConnectionRO = 0;
|
||||
}
|
||||
|
||||
if ( mConnectionRW )
|
||||
{
|
||||
mConnectionRW->disconnect();
|
||||
mConnectionRW = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2870,7 +2872,7 @@ bool QgsPostgresProvider::getGeometryDetails()
|
||||
mEnabledCapabilities &= ~( QgsVectorDataProvider::ChangeGeometries | QgsVectorDataProvider::AddFeatures );
|
||||
}
|
||||
|
||||
QgsDebugMsg( QString( "Feature type name is %1" ).arg( QGis::qgisFeatureTypes[ geometryType()] ) );
|
||||
QgsDebugMsg( QString( "Feature type name is %1" ).arg( QGis::qgisFeatureTypes[ geometryType() ] ) );
|
||||
QgsDebugMsg( QString( "Geometry is geography %1" ).arg( mIsGeography ) );
|
||||
|
||||
return mValid;
|
||||
|
Loading…
x
Reference in New Issue
Block a user