Skip to content

Commit 3ca315b

Browse files
authored
Merge pull request #275 from MiguelCompany/atexit_injection
Allow injection of custom atexit procedure
2 parents 741819b + 05157cc commit 3ca315b

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

include/boost/interprocess/detail/intermodule_singleton_common.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ class intermodule_singleton_impl
421421
} BOOST_INTERPROCESS_CATCH_END
422422
}
423423
//if(Phoenix){
424-
std::atexit(&atexit_work);
424+
BOOST_INTERPROCESS_ATEXIT(&atexit_work);
425425
//}
426426
atomic_inc32(&rcount->singleton_ref_count);
427427
ret_ptr = rcount->ptr;

include/boost/interprocess/detail/workaround.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,4 +375,8 @@ namespace boost {
375375

376376
#endif //!defined(DISABLE_BOOST_INTERPROCESS_EINTR_RETRY) && defined(__GNUC__)
377377

378+
#if !defined(BOOST_INTERPROCESS_ATEXIT)
379+
#define BOOST_INTERPROCESS_ATEXIT(f) std::atexit((f))
380+
#endif //!defined(BOOST_INTERPROCESS_ATEXIT)
381+
378382
#endif //#ifndef BOOST_INTERPROCESS_DETAIL_WORKAROUND_HPP

0 commit comments

Comments
 (0)