[QGIS Commit] r9986 - in branches/Version-1_0/src: core providers/grass

svn_qgis at osgeo.org svn_qgis at osgeo.org
Mon Jan 19 20:13:31 EST 2009


Author: wonder
Date: 2009-01-19 20:13:31 -0500 (Mon, 19 Jan 2009)
New Revision: 9986

Modified:
   branches/Version-1_0/src/core/qgsfeature.cpp
   branches/Version-1_0/src/providers/grass/qgsgrassprovider.cpp
Log:
Ported fix for #1427 from trunk


Modified: branches/Version-1_0/src/core/qgsfeature.cpp
===================================================================
--- branches/Version-1_0/src/core/qgsfeature.cpp	2009-01-20 01:11:06 UTC (rev 9985)
+++ branches/Version-1_0/src/core/qgsfeature.cpp	2009-01-20 01:13:31 UTC (rev 9986)
@@ -61,9 +61,14 @@
   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 );
 

Modified: branches/Version-1_0/src/providers/grass/qgsgrassprovider.cpp
===================================================================
--- branches/Version-1_0/src/providers/grass/qgsgrassprovider.cpp	2009-01-20 01:11:06 UTC (rev 9985)
+++ branches/Version-1_0/src/providers/grass/qgsgrassprovider.cpp	2009-01-20 01:13:31 UTC (rev 9986)
@@ -293,7 +293,7 @@
   int cat, type, id;
   unsigned char *wkb;
   int wkbsize;
-
+  
   QgsDebugMsgLevel( "entered.", 3 );
 
   if ( isEdited() || isFrozen() || !mValid )
@@ -318,7 +318,7 @@
   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 */



More information about the QGIS-commit mailing list