Skip to content
Permalink
Browse files
fixed two small memory leaks
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@5391 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Apr 28, 2006
1 parent ae4e603 commit 2123e4b9292b0a26a1a3289eab3663df98556868
Showing with 5 additions and 3 deletions.
  1. +4 −3 src/core/qgsproviderregistry.cpp
  2. +1 −0 src/gui/qgsvectorlayer.cpp
@@ -361,6 +361,7 @@ QgsDataProvider* QgsProviderRegistry::getProvider( QString const & providerKey,
#endif
if (dataProvider->isValid())
{
delete myLib;
return dataProvider;
}
else
@@ -369,7 +370,7 @@ QgsDataProvider* QgsProviderRegistry::getProvider( QString const & providerKey,
QgsDebugMsg( "Invalid data provider" );

myLib->unload();

delete myLib;
return 0;
}
}
@@ -378,15 +379,15 @@ QgsDataProvider* QgsProviderRegistry::getProvider( QString const & providerKey,
QgsLogger::warning( "Unable to instantiate the data provider plugin" );

myLib->unload();

delete myLib;
return 0;
}
}
}
else
{
QgsLogger::warning( "Failed to load ../providers/libproviders.so" );

delete myLib;
return 0;
}

@@ -172,6 +172,7 @@ QgsVectorLayer::~QgsVectorLayer()
delete popMenu;
// delete the provider lib pointer
delete myLib;
delete mLabel;

// Destroy and cached geometries and clear the references to them
for (std::map<int, QgsGeometry*>::iterator it = mCachedGeometries.begin();

0 comments on commit 2123e4b

Please sign in to comment.