Ticket #2339: boost-destruction-order-fix.diff
File boost-destruction-order-fix.diff, 1.2 KB (added by , 14 years ago) |
---|
-
boost/interprocess/segment_manager.hpp
old new class segment_manager 1130 1130 if(!buffer_ptr) 1131 1131 return 0; 1132 1132 } 1133 1134 //Build scoped ptr to avoid leaks with constructor exception 1135 //Memory can only be deallocated after the node is erased 1136 detail::mem_algo_deallocator<segment_manager_base_type> mem 1137 (buffer_ptr, *static_cast<segment_manager_base_type*>(this)); 1138 1133 1139 1134 1140 //Now construct the intrusive hook plus the header 1135 1141 intrusive_value_type * intrusive_hdr = new(buffer_ptr) intrusive_value_type(); … … class segment_manager 1157 1163 //if something goes wrong 1158 1164 value_eraser<index_type> v_eraser(index, it); 1159 1165 1160 //Avoid constructions if constructor is trivial1161 //Build scoped ptr to avoid leaks with constructor exception1162 detail::mem_algo_deallocator<segment_manager_base_type> mem1163 (buffer_ptr, *static_cast<segment_manager_base_type*>(this));1164 1165 1166 //Construct array, this can throw 1166 1167 detail::array_construct(ptr, num, table); 1167 1168