Skip to content

Commit

Permalink
Revert "QgsGeometry to datastream -> avoid extra data copy"
Browse files Browse the repository at this point in the history
This reverts commit c1b512f.
  • Loading branch information
m-kuhn committed Dec 23, 2015
1 parent c1b512f commit b602c5c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core/geometry/qgsgeometry.cpp
Expand Up @@ -2292,6 +2292,8 @@ QDataStream& operator>>( QDataStream& in, QgsGeometry& geometry )
return in;
}

geometry.fromWkb( reinterpret_cast<unsigned char*>( byteArray.data() ), byteArray.size() );
char *data = new char[byteArray.size()];
memcpy( data, byteArray.data(), byteArray.size() );
geometry.fromWkb( reinterpret_cast< unsigned char* >( data ), byteArray.size() );
return in;
}

0 comments on commit b602c5c

Please sign in to comment.