Skip to content

Commit 273bd37

Browse files
committed
Swap two lines of code so that if a connection attempt is cancelled, SP does not try to open another connection to cancel the pending connection (#2909)
1 parent 3477d22 commit 273bd37

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Frameworks/SPMySQLFramework/Source/SPMySQLConnection.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,11 +1007,11 @@ - (void)_disconnect
10071007
return;
10081008
}
10091009

1010-
state = SPMySQLDisconnecting;
1011-
10121010
// If a query is active, cancel it
10131011
[self cancelCurrentQuery];
10141012

1013+
state = SPMySQLDisconnecting;
1014+
10151015
// Allow any pings or cancelled queries to complete, inside a time limit of ten seconds
10161016
uint64_t disconnectStartTime_t = mach_absolute_time();
10171017
while (![self _tryLockConnection]) {

0 commit comments

Comments
 (0)