aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorGravatar Attila Molnar2014-01-30 21:44:51 +0100
committerGravatar Attila Molnar2014-01-30 21:44:51 +0100
commit5ac1ffce1168c4e3409e6667ff30285bfbc82bde (patch)
tree09b4ab975d5bfd221aa1341d722524b97764fe4f /include
parentm_spanningtree Rewrite /map (diff)
downloadinspircd++-5ac1ffce1168c4e3409e6667ff30285bfbc82bde.tar.gz
inspircd++-5ac1ffce1168c4e3409e6667ff30285bfbc82bde.tar.bz2
inspircd++-5ac1ffce1168c4e3409e6667ff30285bfbc82bde.zip
Allow Timers to delete themselves in Tick()
Diffstat (limited to 'include')
-rw-r--r--include/modules/dns.h1
-rw-r--r--include/timer.h2
2 files changed, 3 insertions, 0 deletions
diff --git a/include/modules/dns.h b/include/modules/dns.h
index 905e52a34..7f863fcca 100644
--- a/include/modules/dns.h
+++ b/include/modules/dns.h
@@ -185,6 +185,7 @@ namespace DNS
Query rr(*this);
rr.error = ERROR_TIMEDOUT;
this->OnError(&rr);
+ delete this;
return false;
}
};
diff --git a/include/timer.h b/include/timer.h
index 2887e2b52..503fa82a2 100644
--- a/include/timer.h
+++ b/include/timer.h
@@ -87,6 +87,8 @@ class CoreExport Timer
/** 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;