Query rr(*this);
rr.error = ERROR_TIMEDOUT;
this->OnError(&rr);
+ delete this;
return false;
}
};
/** Called when the timer ticks.
* You should override this method with some useful code to
* handle the tick event.
+ * @param TIME The current time.
+ * @return True if the Timer object is still valid, false if it was destructed.
*/
virtual bool Tick(time_t TIME) = 0;
ServerInstance->Logs->Log("SOCKET", LOG_DEBUG, "SocketTimeout::Tick");
if (ServerInstance->SE->GetRef(this->sfd) != this->sock)
+ {
+ delete this;
return false;
+ }
if (this->sock->state == I_CONNECTING)
{
}
this->sock->Timeout = NULL;
+ delete this;
return false;
}
{
mod->retimer = NULL;
mod->ReadConf();
+ delete this;
return false;
}
Timers.erase(i++);
if (!t->Tick(TIME))
- delete t;
- else if (t->GetRepeat())
+ continue;
+
+ if (t->GetRepeat())
{
t->SetTrigger(TIME + t->GetInterval());
AddTimer(t);