Skip to content

Commit

Permalink
fixed two small memory leaks
Browse files Browse the repository at this point in the history
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 2123e4b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/core/qgsproviderregistry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@ QgsDataProvider* QgsProviderRegistry::getProvider( QString const & providerKey,
#endif
if (dataProvider->isValid())
{
delete myLib;
return dataProvider;
}
else
Expand All @@ -369,7 +370,7 @@ QgsDataProvider* QgsProviderRegistry::getProvider( QString const & providerKey,
QgsDebugMsg( "Invalid data provider" );

myLib->unload();

delete myLib;
return 0;
}
}
Expand All @@ -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;
}

Expand Down
1 change: 1 addition & 0 deletions src/gui/qgsvectorlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 2123e4b

Please sign in to comment.