Skip to content

Commit

Permalink
Fix for ticket #445 qgis crash deleting point in postgis table
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@6269 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Dec 16, 2006
1 parent 9f15257 commit 61cd9bd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
7 changes: 6 additions & 1 deletion src/core/qgsfeature.cpp
Expand Up @@ -1437,7 +1437,12 @@ QgsPoint QgsFeature::closestVertex(const QgsPoint& point) const
//
QgsRect QgsFeature::boundingBox() const
{
return mGeometry->boundingBox();
if(mGeometry)
{
return mGeometry->boundingBox();
}
QgsRect nullRect;
return nullRect;
}
// QgsRect QgsFeature::boundingBox() const
// {
Expand Down
8 changes: 6 additions & 2 deletions src/gui/qgsvectorlayer.cpp
Expand Up @@ -853,6 +853,7 @@ void QgsVectorLayer::draw(QPainter * p,
{
if (mDeletedFeatureIds.find(fet->featureId()) != mDeletedFeatureIds.end())
{
delete fet;
continue; //dont't draw feature marked as deleted
}
if (mChangedGeometries.find(fet->featureId()) != mChangedGeometries.end())
Expand Down Expand Up @@ -1557,8 +1558,11 @@ void QgsVectorLayer::updateExtents()
{
if(mDeletedFeatureIds.find(fet->featureId())==mDeletedFeatureIds.end())
{
bb=fet->boundingBox();
layerExtent.combineExtentWith(&bb);
if(fet->geometry())
{
bb=fet->boundingBox();
layerExtent.combineExtentWith(&bb);
}
}
delete fet;
}
Expand Down

0 comments on commit 61cd9bd

Please sign in to comment.