Skip to content
Snippets Groups Projects
Verified Commit fc9e3923 authored by Jeremy Soller's avatar Jeremy Soller
Browse files

drop DIR pointers again

parent de429a8d
No related branches found
No related tags found
No related merge requests found
...@@ -57,20 +57,12 @@ pub unsafe extern "C" fn opendir(path: *const c_char) -> *mut DIR { ...@@ -57,20 +57,12 @@ pub unsafe extern "C" fn opendir(path: *const c_char) -> *mut DIR {
#[no_mangle] #[no_mangle]
pub unsafe extern "C" fn closedir(dir: *mut DIR) -> c_int { pub unsafe extern "C" fn closedir(dir: *mut DIR) -> c_int {
let mut dir = Box::from_raw(dir);
let ret = { let ret = Sys::close(*dir.file);
let mut dir = Box::from_raw(dir);
let ret = Sys::close(*dir.file); // Reference files aren't closed when dropped
dir.file.reference = true;
// Reference files aren't closed when dropped
dir.file.reference = true;
//TODO: find out why dropping dir can crash
mem::forget(dir);
ret
};
ret ret
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment