Skip to content

Commit 61cd9bd

Browse files
author
mhugent
committedDec 16, 2006
Fix for ticket #445 qgis crash deleting point in postgis table
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@6269 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 9f15257 commit 61cd9bd

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed
 

‎src/core/qgsfeature.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1437,7 +1437,12 @@ QgsPoint QgsFeature::closestVertex(const QgsPoint& point) const
14371437
//
14381438
QgsRect QgsFeature::boundingBox() const
14391439
{
1440-
return mGeometry->boundingBox();
1440+
if(mGeometry)
1441+
{
1442+
return mGeometry->boundingBox();
1443+
}
1444+
QgsRect nullRect;
1445+
return nullRect;
14411446
}
14421447
// QgsRect QgsFeature::boundingBox() const
14431448
// {

‎src/gui/qgsvectorlayer.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -853,6 +853,7 @@ void QgsVectorLayer::draw(QPainter * p,
853853
{
854854
if (mDeletedFeatureIds.find(fet->featureId()) != mDeletedFeatureIds.end())
855855
{
856+
delete fet;
856857
continue; //dont't draw feature marked as deleted
857858
}
858859
if (mChangedGeometries.find(fet->featureId()) != mChangedGeometries.end())
@@ -1557,8 +1558,11 @@ void QgsVectorLayer::updateExtents()
15571558
{
15581559
if(mDeletedFeatureIds.find(fet->featureId())==mDeletedFeatureIds.end())
15591560
{
1560-
bb=fet->boundingBox();
1561-
layerExtent.combineExtentWith(&bb);
1561+
if(fet->geometry())
1562+
{
1563+
bb=fet->boundingBox();
1564+
layerExtent.combineExtentWith(&bb);
1565+
}
15621566
}
15631567
delete fet;
15641568
}

0 commit comments

Comments
 (0)