Skip to content

Commit e02057c

Browse files
olsonjefferybrson
authored andcommitted
std: fail if exiting hl_loop has unref_handles at weaken_task exit
1 parent a9db0c9 commit e02057c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/libstd/uv_hl.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -269,9 +269,10 @@ crust fn high_level_wake_up_cb(async_handle: *ll::uv_async_t,
269269
crust fn tear_down_close_cb(handle: *ll::uv_async_t) unsafe {
270270
log(debug, #fmt("tear_down_close_cb called, closing handle at %?",
271271
handle));
272-
// TODO: iterate through open handles on the loop and uv_close()
273-
// them all
274-
//let data = ll::get_data_for_uv_handle(handle) as *global_loop_data;
272+
let data = ll::get_data_for_uv_handle(handle) as *global_loop_data;
273+
if vec::len((*data).refd_handles) > 0 {
274+
fail "Didn't unref all high-level handles";
275+
}
275276
}
276277

277278
fn high_level_tear_down(data: *global_loop_data) unsafe {

0 commit comments

Comments
 (0)