From 4d97cbd4df1ebb451d89d6c4e12dd7c622d00b84 Mon Sep 17 00:00:00 2001 From: Max Date: Sat, 17 Oct 2015 21:26:30 +0200 Subject: This change will either reduce the amount of crashes or increase the amount of beachballing. In the latter case please file an issue. --- .../Source/SPMySQLConnection Categories/Ping & KeepAlive.m | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Frameworks/SPMySQLFramework/Source/SPMySQLConnection Categories/Ping & KeepAlive.m b/Frameworks/SPMySQLFramework/Source/SPMySQLConnection Categories/Ping & KeepAlive.m index 0c455242..c4469f5c 100644 --- a/Frameworks/SPMySQLFramework/Source/SPMySQLConnection Categories/Ping & KeepAlive.m +++ b/Frameworks/SPMySQLFramework/Source/SPMySQLConnection Categories/Ping & KeepAlive.m @@ -186,6 +186,9 @@ end: keepAliveLastPingBlocked = YES; } } while (keepAlivePingThreadActive); + + //wait for thread to go away, otherwise our free() below might run before _pingThreadCleanup() + pthread_join(keepAlivePingThread_t, NULL); // Clean up keepAlivePingThread_t = NULL; -- cgit v1.2.3