From 87b34c94fa47cac4be62011e448f8e2cffc73ca6 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Fri, 14 Oct 2011 15:00:37 +0000 Subject: [PATCH] timer_wrap: add sanity check assert --- src/timer_wrap.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/timer_wrap.cc b/src/timer_wrap.cc index cfae78d2a7..99db0c5d6d 100644 --- a/src/timer_wrap.cc +++ b/src/timer_wrap.cc @@ -67,7 +67,10 @@ class TimerWrap : public HandleWrap { TimerWrap(Handle object) : HandleWrap(object, (uv_handle_t*) &handle_) { active_ = false; + int r = uv_timer_init(uv_default_loop(), &handle_); + assert(r == 0); + handle_.data = this; // uv_timer_init adds a loop reference. (That is, it calls uv_ref.) This