Opened 9 years ago

Last modified 9 years ago

#5959 closed enhancement

Add a copy constructor to OGRFeatureDefn — at Initial Version

Reported by: yzhong Owned by: warmerdam
Priority: normal Milestone:
Component: default Version: svn-trunk
Severity: normal Keywords:
Cc:

Description

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.

OGRFeatureDefn oFeatureDefn;

oFeatureDefn = OGRFeatureDefn( pszLayerName );

oFeatureDefn.SetGeomType( wkbNone ); crash

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.

Change History (0)

Note: See TracTickets for help on using tickets.