Skip to content

Commit fd5aed7

Browse files
committed
Prevent hdf5 calling atexit() closing handles
This could create double free situations, where an orphaned thread would try to access a handle after it's been freed by the main thread.
1 parent 40654f1 commit fd5aed7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/globals.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ use crate::internal_prelude::*;
1818

1919
lazy_static! {
2020
static ref LIBRARY_INIT: () = {
21-
h5lock!(::hdf5_sys::h5::H5open());
21+
h5lock!({
22+
::hdf5_sys::h5::H5dont_atexit();
23+
::hdf5_sys::h5::H5open();
24+
});
2225
let _e = crate::hl::filters::register_filters();
2326
};
2427
}

0 commit comments

Comments
 (0)