diff --git a/ActiveSync/SOGoActiveSyncDispatcher+Sync.m b/ActiveSync/SOGoActiveSyncDispatcher+Sync.m index 21425a1c1..a0cf6b1b3 100644 --- a/ActiveSync/SOGoActiveSyncDispatcher+Sync.m +++ b/ActiveSync/SOGoActiveSyncDispatcher+Sync.m @@ -1868,7 +1868,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // We enter our loop detection change for (i = 0; i < (heartbeatInterval/internalInterval); i++) { - if (shouldTerminate) + if ([self easShouldTerminate]) break; s = [NSMutableString string]; @@ -1910,7 +1910,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. { total_sleep = 0; - while (!shouldTerminate && total_sleep < internalInterval) + while (![self easShouldTerminate] && total_sleep < internalInterval) { // We check if we must break the current synchronization since an other Sync // has just arrived. diff --git a/ActiveSync/SOGoActiveSyncDispatcher.h b/ActiveSync/SOGoActiveSyncDispatcher.h index 7035e8906..8de3f9005 100644 --- a/ActiveSync/SOGoActiveSyncDispatcher.h +++ b/ActiveSync/SOGoActiveSyncDispatcher.h @@ -38,7 +38,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. @class NSURL; @class NSNumber; -static volatile BOOL shouldTerminate = NO; +static volatile BOOL easShouldTerminate = NO; @interface SOGoActiveSyncDispatcher : NSObject { @@ -64,5 +64,6 @@ static volatile BOOL shouldTerminate = NO; - (NSURL *) folderTableURL; - (void) ensureFolderTableExists; +- (BOOL) easShouldTerminate; @end diff --git a/ActiveSync/SOGoActiveSyncDispatcher.m b/ActiveSync/SOGoActiveSyncDispatcher.m index 1d9dd4738..a076657eb 100644 --- a/ActiveSync/SOGoActiveSyncDispatcher.m +++ b/ActiveSync/SOGoActiveSyncDispatcher.m @@ -126,7 +126,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. void handle_eas_terminate(int signum) { NSLog(@"Forcing termination of EAS loop."); - shouldTerminate = YES; + easShouldTerminate = YES; [[WOCoreApplication application] terminateAfterTimeInterval: 1]; } @@ -148,7 +148,7 @@ void handle_eas_terminate(int signum) imapFolderGUIDS = nil; syncRequest = nil; - shouldTerminate = NO; + easShouldTerminate = NO; signal(SIGTERM, handle_eas_terminate); return self; @@ -2141,7 +2141,7 @@ void handle_eas_terminate(int signum) // We enter our loop detection change for (i = 0; i < (heartbeatInterval/internalInterval); i++) { - if (shouldTerminate) + if (easShouldTerminate) break; pool = [[NSAutoreleasePool alloc] init]; @@ -2181,7 +2181,7 @@ void handle_eas_terminate(int signum) { total_sleep = 0; - while (!shouldTerminate && total_sleep < internalInterval) + while (!easShouldTerminate && total_sleep < internalInterval) { // We check if we must break the current ping request since an other ping request // has just arrived. @@ -3457,4 +3457,9 @@ void handle_eas_terminate(int signum) [cm releaseChannel: channel]; } +- (BOOL) easShouldTerminate +{ + return easShouldTerminate; +} + @end