Changes between Version 2 and Version 3 of Ticket #5959


Ignore:
Timestamp:
May 12, 2015, 10:33:31 AM (9 years ago)
Author:
yzhong
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #5959

    • Property Summary Add a copy constructor to OGRFeatureDefnAdd a copy constructor and copy assignment operator to OGRFeatureDefn
  • Ticket #5959 – Description

    v2 v3  
    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.
     1I 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.
    22       
    33
     
    99
    1010
    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.
    12 
    13 As a matter of fact, I think we need [http://en.wikipedia.org/wiki/Rule_of_three_%28C%2B%2B_programming%29 Rule of 5] to make it safe to use.
     11Should 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 [http://en.wikipedia.org/wiki/Rule_of_three_%28C%2B%2B_programming%29 rule of 5] will be better.