fix bug in event-scheduler
diff --git a/test/test-event-scheduler.cc b/test/test-event-scheduler.cc
index 4642d95..41ae4e0 100644
--- a/test/test-event-scheduler.cc
+++ b/test/test-event-scheduler.cc
@@ -71,7 +71,6 @@
   BOOST_CHECK_EQUAL(scheduler->size(), 1);
   usleep(1000000);
 
-  scheduler->shutdown();
 
   int hello = 0, world = 0, period = 0;
 
@@ -99,6 +98,7 @@
   // invoked every 0.2 seconds before deleted by matcher
   BOOST_CHECK_EQUAL(period, static_cast<int>((0.6 + 0.6 + 0.4 + 0.2 + 0.1) / 0.2));
 
+  scheduler->shutdown();
 }
 
 BOOST_AUTO_TEST_CASE(GeneratorTest)