Changes between Initial Version and Version 1 of Ticket #5959
- Timestamp:
- May 12, 2015, 9:58:46 AM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #5959 – Description
initial v1 1 1 I think we should add a copy constructor to OGRFeatureDefn. Otherwise, the following code will crash. The reason is obvious that the memory of papoGeomFieldDefn is getting released. 2 2 3 4 {{{ 3 5 OGRFeatureDefn oFeatureDefn; 6 oFeatureDefn = OGRFeatureDefn( pszLayerName ); 7 oFeatureDefn.SetGeomType( wkbNone ); // crash 8 }}} 4 9 5 oFeatureDefn = OGRFeatureDefn( pszLayerName );6 7 oFeatureDefn.SetGeomType( wkbNone ); // crash8 10 9 11 If you don't want to implement the copy constructor, should at least mark it as delete (C++11) or make it private to prevent developers of making mistakes by calling it.