summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/threadengine.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/threadengine.cpp b/src/threadengine.cpp
index e7a316282..faa020234 100644
--- a/src/threadengine.cpp
+++ b/src/threadengine.cpp
@@ -20,4 +20,14 @@
#include "inspircd.h"
#include "threadengine.h"
-
+/** If this thread has a Creator set, call it to
+ * free the thread
+ */
+virtual ~Thread::Thread()
+{
+ if (state)
+ {
+ state->FreeThread(this);
+ delete state;
+ }
+}