From 8e89c9383f4e3beeb586b448a9aa2f86b23376f3 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 29 Nov 2007 17:36:35 +0000 Subject: [PATCH 1/1] fix bug reported by chris brody --- ev++.h | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/ev++.h b/ev++.h index 5133af0..c51e161 100644 --- a/ev++.h +++ b/ev++.h @@ -250,6 +250,7 @@ namespace ev { void start (const char *path, ev_tstamp interval = 0.) { + stop (); set (path, interval); start (); } @@ -275,17 +276,10 @@ namespace ev { #if EV_EMBED_ENABLE EV_BEGIN_WATCHER (embed, embed) - void set (struct ev_loop *loop) - { - int active = is_active (); - if (active) stop (); - ev_embed_set (static_cast(this), loop); - if (active) start (); - } - void start (struct ev_loop *embedded_loop) { - set (embedded_loop); + stop (); + ev_embed_set (static_cast(this), embedded_loop); start (); } -- 2.43.0