From e02057c5a58bd5498c59bbe769bfd327721f4c8d Mon Sep 17 00:00:00 2001 From: Jeff Olson Date: Thu, 19 Apr 2012 05:59:37 -0700 Subject: [PATCH] std: fail if exiting hl_loop has unref_handles at weaken_task exit --- src/libstd/uv_hl.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/libstd/uv_hl.rs b/src/libstd/uv_hl.rs index 7eaf52ad96f..48d37753208 100644 --- a/src/libstd/uv_hl.rs +++ b/src/libstd/uv_hl.rs @@ -269,9 +269,10 @@ crust fn high_level_wake_up_cb(async_handle: *ll::uv_async_t, crust fn tear_down_close_cb(handle: *ll::uv_async_t) unsafe { log(debug, #fmt("tear_down_close_cb called, closing handle at %?", handle)); - // TODO: iterate through open handles on the loop and uv_close() - // them all - //let data = ll::get_data_for_uv_handle(handle) as *global_loop_data; + let data = ll::get_data_for_uv_handle(handle) as *global_loop_data; + if vec::len((*data).refd_handles) > 0 { + fail "Didn't unref all high-level handles"; + } } fn high_level_tear_down(data: *global_loop_data) unsafe {