summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/thread_pthread.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/thread_pthread.cpp b/src/thread_pthread.cpp
index bcfaf8c85..3f55750a1 100644
--- a/src/thread_pthread.cpp
+++ b/src/thread_pthread.cpp
@@ -68,7 +68,10 @@ private:
NOT_REACHED();
}
- if (self_destruct) delete this;
+ if (self_destruct) {
+ pthread_detach(pthread_self());
+ delete this;
+ }
}
};