| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -149,8 +149,10 @@ Handle<Value> Timer::Again(const Arguments& args) { | |||
| 149 | 149 | ||
| 150 | 150 | int was_active = ev_is_active(&timer->watcher_); | |
| 151 | 151 | ||
| 152 | - ev_tstamp repeat = NODE_V8_UNIXTIME(args[0]); | ||
| 153 | - if (repeat > 0) timer->watcher_.repeat = repeat; | ||
| 152 | + if (args.Length() > 0) { | ||
| 153 | + ev_tstamp repeat = NODE_V8_UNIXTIME(args[0]); | ||
| 154 | + if (repeat > 0) timer->watcher_.repeat = repeat; | ||
| 155 | + } | ||
| 154 | 156 | ||
| 155 | 157 | ev_timer_again(EV_DEFAULT_UC_ &timer->watcher_); | |
| 156 | 158 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -15,7 +15,10 @@ class Timer : ObjectWrap { | |||
| 15 | 15 | protected: | |
| 16 | 16 | static v8::Persistent<v8::FunctionTemplate> constructor_template; | |
| 17 | 17 | ||
| 18 | - Timer () : ObjectWrap () { } | ||
| 18 | + Timer () : ObjectWrap () { | ||
| 19 | + // dummy timeout values | ||
| 20 | + ev_timer_init(&watcher_, OnTimeout, 0., 1.); | ||
| 21 | + } | ||
| 19 | 22 | ~Timer(); | |
| 20 | 23 | ||
| 21 | 24 | static v8::Handle<v8::Value> New (const v8::Arguments& args); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments