Opened 9 years ago
Closed 9 years ago
#5959 closed enhancement (duplicate)
Add a copy constructor and copy assignment operator to OGRFeatureDefn
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 (6)
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 |
comment:4 by , 9 years ago
Note:
See TracTickets
for help on using tickets.
More or less linked to #5043