- bActive = bSingleShot = true;
- interval = 0;
- clock_gettime(CLOCK_MONOTONIC, &nextActivation);
-// eDebug("this = %p\nnow sec = %d, nsec = %d\nadd %d sec", this, nextActivation.tv_sec, nextActivation.tv_nsec, seconds);
- if ( seconds > 0 )
- nextActivation.tv_sec += seconds;
-// eDebug("next Activation sec = %d, nsec = %d", nextActivation.tv_sec, nextActivation.tv_nsec );
- context.addTimer(this);
+ if (eMainloop::isValid(&context))
+ {
+ bActive = bSingleShot = true;
+ interval = 0;
+ clock_gettime(CLOCK_MONOTONIC, &nextActivation);
+// eDebug("this = %p\nnow sec = %d, nsec = %d\nadd %d sec", this, nextActivation.tv_sec, nextActivation.tv_nsec, seconds);
+ if ( seconds > 0 )
+ nextActivation.tv_sec += seconds;
+// eDebug("next Activation sec = %d, nsec = %d", nextActivation.tv_sec, nextActivation.tv_nsec );
+ context.addTimer(this);
+ }