Ticket #10707: fix_copy_ctr.patch
File fix_copy_ctr.patch, 1.2 KB (added by , 8 years ago) |
---|
-
subgraph.hpp.
old new 131 131 132 132 // copy constructor 133 133 subgraph(const subgraph& x) 134 : m_parent(x.m_parent), m_ edge_counter(x.m_edge_counter)134 : m_parent(x.m_parent), m_graph(x.m_graph), m_edge_counter(x.m_edge_counter) 135 135 , m_global_vertex(x.m_global_vertex), m_global_edge(x.m_global_edge) 136 , m_local_vertex(x.m_local_vertex), m_local_edge(x.m_local_edge) 136 137 { 137 if(x.is_root())138 {139 m_graph = x.m_graph;140 }141 138 // Do a deep copy (recursive). 142 139 // Only the root graph is copied, the subgraphs contain 143 140 // only references to the global vertices they own. 144 141 typename subgraph<Graph>::children_iterator i,i_end; 145 142 boost::tie(i,i_end) = x.children(); 146 143 for(; i != i_end; ++i) 147 { 144 { 148 145 subgraph<Graph> child = this->create_subgraph(); 149 146 child = *i; 150 vertex_iterator vi,vi_end; 147 vertex_iterator vi,vi_end; 151 148 boost::tie(vi,vi_end) = vertices(*i); 152 for (;vi!=vi_end;++vi) 149 for (;vi!=vi_end;++vi) 153 150 { 154 151 add_vertex(*vi,child); 155 152 }