summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Schleifer <js@heap.zone>2019-09-01 20:25:13 +0200
committerJonathan Schleifer <js@heap.zone>2019-09-01 20:25:13 +0200
commit3f155d138ce8b417b600e68e998b1bc7474ff71a (patch)
tree99a9aeab55b493bb2e09376311c7cdca158a7fbc
parent35d55346a6d8c5e414de004519bae786953bb03a (diff)
Disallow +[OFThread terminate] on main thread
-rw-r--r--src/OFThread.m3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/OFThread.m b/src/OFThread.m
index cac9291b..50a3063a 100644
--- a/src/OFThread.m
+++ b/src/OFThread.m
@@ -315,6 +315,9 @@ static OFDNSResolver *DNSResolver;
{
OFThread *thread = of_tlskey_get(threadSelfKey);
+ if (thread == mainThread)
+ @throw [OFInvalidArgumentException exception];
+
OF_ENSURE(thread != nil);
thread->_returnValue = [object retain];