From a6ffcaa5e07bb286b06f761d902e44b7fefaaaed Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Thu, 18 Mar 2010 15:31:30 +0000 Subject: - Move streaming query result connection unlocking to the download thread rather than the data processing thread. This ensures the connection unlock is walys called - even when no data is present - thus addressing Issue #594. (Prior to r1931 manual memory management caught this case anyway) --- Frameworks/MCPKit/MCPFoundationKit/MCPStreamingResult.m | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Frameworks/MCPKit') diff --git a/Frameworks/MCPKit/MCPFoundationKit/MCPStreamingResult.m b/Frameworks/MCPKit/MCPFoundationKit/MCPStreamingResult.m index fd7d181b..bf8a2599 100644 --- a/Frameworks/MCPKit/MCPFoundationKit/MCPStreamingResult.m +++ b/Frameworks/MCPKit/MCPFoundationKit/MCPStreamingResult.m @@ -193,9 +193,6 @@ // Update the connection's error statuses in case of error during content download [parentConnection updateErrorStatuses]; - // Unlock the connection and return - [parentConnection unlockConnection]; - connectionUnlocked = YES; return nil; } @@ -461,6 +458,10 @@ pthread_mutex_unlock(&dataFreeLock); } + // Unlock the parent connection now data has been retrieved + connectionUnlocked = YES; + [parentConnection unlockConnection]; + dataDownloaded = YES; [downloadPool drain]; } -- cgit v1.2.3