Closed adalisk-emikhaylov closed 1 month ago
This fixes https://github.com/boostorg/interprocess/issues/192 and https://github.com/boostorg/interprocess/issues/210 (which seem to describe the same bug).
Here's the code I'm testing this on. I'm using VS 2022 (though some coworkers with the same compiler can't reproduce, I'm not entirely sure why)
#define BOOST_INTERPROCESS_FORCE_NATIVE_EMULATION 1 // This is important, doesn't crash otherwise. #include <boost/interprocess/allocators/allocator.hpp> #include <boost/interprocess/managed_windows_shared_memory.hpp> #include <boost/interprocess/smart_ptr/unique_ptr.hpp> #include <iostream> int main() { std::cout << "Before\n"; { namespace bip = boost::interprocess; // Destructor of `x` crashes. auto x = bip::managed_windows_shared_memory( bip::open_or_create, "blah", bip::mapped_region::get_page_size() ); } std::cout << "After\n"; }
@igaztanaga A friendly ping.
Many thanks for the pull request!
This fixes https://github.com/boostorg/interprocess/issues/192 and https://github.com/boostorg/interprocess/issues/210 (which seem to describe the same bug).
Here's the code I'm testing this on. I'm using VS 2022 (though some coworkers with the same compiler can't reproduce, I'm not entirely sure why)