--- source/boost/interprocess/segment_manager.hpp 2008-06-23 21:20:30.000000000 +0300 +++ root/include/boost/interprocess/segment_manager.hpp 2008-09-17 18:17:38.000000000 +0300 @@ -1130,6 +1130,12 @@ class segment_manager if(!buffer_ptr) return 0; } + + //Build scoped ptr to avoid leaks with constructor exception + //Memory can only be deallocated after the node is erased + detail::mem_algo_deallocator mem + (buffer_ptr, *static_cast(this)); + //Now construct the intrusive hook plus the header intrusive_value_type * intrusive_hdr = new(buffer_ptr) intrusive_value_type(); @@ -1157,11 +1163,6 @@ class segment_manager //if something goes wrong value_eraser v_eraser(index, it); - //Avoid constructions if constructor is trivial - //Build scoped ptr to avoid leaks with constructor exception - detail::mem_algo_deallocator mem - (buffer_ptr, *static_cast(this)); - //Construct array, this can throw detail::array_construct(ptr, num, table);