[QGIS Commit] r9168 - trunk/qgis/src/plugins/spit

svn_qgis at osgeo.org svn_qgis at osgeo.org
Mon Aug 25 15:10:58 EDT 2008


Author: jef
Date: 2008-08-25 15:10:58 -0400 (Mon, 25 Aug 2008)
New Revision: 9168

Modified:
   trunk/qgis/src/plugins/spit/qgsshapefile.cpp
Log:
fix spit plugin

Modified: trunk/qgis/src/plugins/spit/qgsshapefile.cpp
===================================================================
--- trunk/qgis/src/plugins/spit/qgsshapefile.cpp	2008-08-25 14:15:49 UTC (rev 9167)
+++ trunk/qgis/src/plugins/spit/qgsshapefile.cpp	2008-08-25 19:10:58 UTC (rev 9168)
@@ -18,6 +18,7 @@
 
 #include <QApplication>
 #include <ogr_api.h>
+#include <cpl_conv.h>
 #include <string>
 #include <fstream>
 #include <cstdio>
@@ -406,14 +407,14 @@
                 .arg( QgsPgUtil::quotedIdentifier( table_name ) )
                 .arg( m );
 
-        int num = OGR_G_WkbSize( geom );
-        char * geo_temp = new char[num*3];
+        char *geo_temp;
         // 'GeometryFromText' supports only 2D coordinates
         // TODO for proper 2.5D support we would need to use 'GeomFromEWKT'
         if ( hasMoreDimensions )
           OGR_G_SetCoordinateDimension( geom, 2 );
         OGR_G_ExportToWkt( geom, &geo_temp );
         QString geometry( geo_temp );
+        CPLFree(geo_temp);
 
         for ( uint n = 0; n < column_types.size(); n++ )
         {
@@ -462,7 +463,6 @@
 
         pro.setValue( pro.value() + 1 );
         qApp->processEvents();
-        delete[] geo_temp;
       }
       OGR_F_Destroy( feat );
     }



More information about the QGIS-commit mailing list