X-Git-Url: http://git.code-monkey.de/?p=ruby-ecore.git;a=blobdiff_plain;f=src%2Fecore%2Frb_timer.c;fp=src%2Fecore%2Frb_timer.c;h=6ef4d75c06d2a26b1240db3bf7fd95d8b8c9cc03;hp=4d05d48d66a4284a91d73a3e2c1e81307285eea5;hb=d6e45172f31e9a724a5da3b99ef26d519740d691;hpb=087974f38a80e4052d828562c01cdb44eacd3bf5 diff --git a/src/ecore/rb_timer.c b/src/ecore/rb_timer.c index 4d05d48..6ef4d75 100644 --- a/src/ecore/rb_timer.c +++ b/src/ecore/rb_timer.c @@ -84,6 +84,11 @@ static VALUE c_init (VALUE self, VALUE interval) if (!rb_block_given_p ()) rb_raise (rb_eStandardError, "block missing"); + interval = rb_funcall2 (interval, rb_intern ("to_f"), 0, NULL); + + if (rb_funcall2 (interval, rb_intern ("finite?"), 0, NULL) == Qfalse) + rb_raise (rb_eArgError, "Argument must not be infinite"); + timer->callback = rb_block_proc (); timer->deleted = false; timer->real = ecore_timer_add (NUM2DBL (interval),