Ignore:
Timestamp:
01/02/13 16:45:16 (16 months ago)
Author:
Ales Erjavec <ales.erjavec@…>
Branch:
default
Children:
11049:f4dd8dbc57bb, 11051:04009d17e84e
Message:

Fixed 'TExampleTable.clone' method (erroneous copy constructor for TExampleTable).

The 'clone' method calls the C++ copy constructor to copy the table,
but the default copy constructor fails to properly copy the instances
(both tables end up claiming ownership of the same memory space).

Fixed by implementing a copy constructor to make a deep copy of
the instances.

Fixes #1260

File:
1 edited

Legend:

Unmodified
Added
Removed
  • source/orange/table.cpp

    r10866 r11048  
    3232#include "table.ppp" 
    3333 
     34 
     35TExampleTable::TExampleTable(const TExampleTable& orig) 
     36: TExampleGenerator(orig.domain), 
     37  examples(NULL), 
     38  _Last(NULL), 
     39  _EndSpace(NULL), 
     40  ownsExamples(true) 
     41{ 
     42  reserve(orig.size()); 
     43  for(int i = 0; i < orig.size(); ++i){ 
     44      push_back(new TExample(orig.at(i))); 
     45  } 
     46} 
    3447 
    3548TExampleTable::TExampleTable(PDomain dom, bool owns) 
Note: See TracChangeset for help on using the changeset viewer.