Opened 9 years ago
Last modified 9 years ago
#5959 closed enhancement
Add a copy constructor and copy assignment operator to OGRFeatureDefn — at Version 3
Reported by: | yzhong | Owned by: | warmerdam |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | default | Version: | svn-trunk |
Severity: | normal | Keywords: | |
Cc: |
Description (last modified by )
I think we should add a copy constructor and copy assignment operator 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
Should at least mark it as delete (C++11) or make it private to prevent developers of making mistakes by calling it. As a matter of fact, adding all rule of 5 will be better.
Change History (3)
comment:1 by , 9 years ago
Description: | modified (diff) |
---|
comment:2 by , 9 years ago
Description: | modified (diff) |
---|---|
Type: | defect → enhancement |
comment:3 by , 9 years ago
Description: | modified (diff) |
---|---|
Summary: | Add a copy constructor to OGRFeatureDefn → Add a copy constructor and copy assignment operator to OGRFeatureDefn |
Note:
See TracTickets
for help on using tickets.