diff options
| author | Jeff Olson <olson.jeffery@gmail.com> | 2012-02-25 22:08:52 -0800 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2012-02-28 17:56:15 -0800 |
| commit | b4c88cdcecbcf40e1b9a123dcb6056970e256e9b (patch) | |
| tree | 6b88cfaea3f23cb9323cc9402a7729b37d7349b1 /src/rt/rust_uv.cpp | |
| parent | 0b3a06ab2ca989ab0f0b9fa5fa8aa83a2ec13998 (diff) | |
| download | rust-b4c88cdcecbcf40e1b9a123dcb6056970e256e9b.tar.gz rust-b4c88cdcecbcf40e1b9a123dcb6056970e256e9b.zip | |
add uv::loop_delete()
because of the last change, the loop ptr is no longer cleaned up when the loop exits. This api call addresses that. Sadly, the loop ptr is not "reusable" across multiple calls to uv::run().
Diffstat (limited to 'src/rt/rust_uv.cpp')
| -rw-r--r-- | src/rt/rust_uv.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/rt/rust_uv.cpp b/src/rt/rust_uv.cpp index 4126896895e..096d40d2235 100644 --- a/src/rt/rust_uv.cpp +++ b/src/rt/rust_uv.cpp @@ -2,7 +2,8 @@ #include "uv.h" // crust fn pointers -typedef void (*crust_async_op_cb)(uv_loop_t* loop, void* data); +typedef void (*crust_async_op_cb)(uv_loop_t* loop, void* data, + uv_async_t* op_handle); typedef void (*crust_simple_cb)(uint8_t* id_buf, void* loop_data); typedef void (*crust_close_cb)(uint8_t* id_buf, void* handle, void* data); @@ -43,7 +44,7 @@ static void native_crust_async_op_cb(uv_async_t* handle, int status) { crust_async_op_cb cb = (crust_async_op_cb)handle->data; void* loop_data = handle->loop->data; - cb(handle->loop, loop_data); + cb(handle->loop, loop_data, handle); } static void @@ -79,6 +80,11 @@ rust_uv_loop_new() { } extern "C" void +rust_uv_loop_delete(uv_loop_t* loop) { + uv_loop_delete(loop); +} + +extern "C" void rust_uv_loop_set_data(uv_loop_t* loop, void* data) { loop->data = data; } |
