Skip to content

Commit

Permalink
Ported fix for #1427 from trunk
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/branches/Version-1_0@9986 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed Jan 20, 2009
1 parent 5546b66 commit faae187
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 6 additions & 1 deletion src/core/qgsfeature.cpp
Expand Up @@ -61,9 +61,14 @@ QgsFeature & QgsFeature::operator=( QgsFeature const & rhs )
mAttributes = rhs.mAttributes;
mValid = rhs.mValid;
mTypeName = rhs.mTypeName;

// make sure to delete the old geometry (if exists)
if (mGeometry && mOwnsGeometry)
delete mGeometry;

mGeometry = 0;
mOwnsGeometry = false;

if ( rhs.mGeometry )
setGeometry( *rhs.mGeometry );

Expand Down
4 changes: 2 additions & 2 deletions src/providers/grass/qgsgrassprovider.cpp
Expand Up @@ -293,7 +293,7 @@ bool QgsGrassProvider::nextFeature( QgsFeature& feature )
int cat, type, id;
unsigned char *wkb;
int wkbsize;

QgsDebugMsgLevel( "entered.", 3 );

if ( isEdited() || isFrozen() || !mValid )
Expand All @@ -318,7 +318,7 @@ bool QgsGrassProvider::nextFeature( QgsFeature& feature )
QgsDebugMsg( QString( "cat = %1 type = %2 id = %3" ).arg( cat ).arg( type ).arg( id ) );
#endif

feature = QgsFeature( id );
feature.setFeatureId(id);

// TODO int may be 64 bits (memcpy)
if ( type & ( GV_POINTS | GV_LINES ) ) /* points or lines */
Expand Down

0 comments on commit faae187

Please sign in to comment.