diff --git a/Source/NSXPCConnection+HelperApp.m b/Source/NSXPCConnection+HelperApp.m index 1d9e276..878c777 100644 --- a/Source/NSXPCConnection+HelperApp.m +++ b/Source/NSXPCConnection+HelperApp.m @@ -92,7 +92,10 @@ int xpc_task_key = 0; endpoint = ep; dispatch_semaphore_signal(sem); }]; - + +#ifdef DEBUG_PRINT + dispatch_semaphore_wait(sem, DISPATCH_TIME_FOREVER); +#else dispatch_time_t waitTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(NSEC_PER_SEC * 2)); if (dispatch_semaphore_wait(sem, waitTime) != 0) { @@ -106,6 +109,7 @@ int xpc_task_key = 0; }]; } } +#endif [cn setInvalidationHandler:nil]; [cn invalidate]; diff --git a/Source/NSXPCListener+HelperApp.m b/Source/NSXPCListener+HelperApp.m index e6c6fd7..4b1038c 100644 --- a/Source/NSXPCListener+HelperApp.m +++ b/Source/NSXPCListener+HelperApp.m @@ -69,7 +69,10 @@ extern NSString *kHelperIdentifierArgumentPrefix; os_log_info(OE_LOG_HELPER, "Successfully connected helper to host. { id = '%{public}@' }", identifier); dispatch_semaphore_signal(sem); }]; - + +#ifdef DEBUG_PRINT + dispatch_semaphore_wait(sem, DISPATCH_TIME_FOREVER); +#else dispatch_time_t waitTime = dispatch_time(DISPATCH_TIME_NOW, NSEC_PER_SEC * 2); if (dispatch_semaphore_wait(sem, waitTime) != 0) { @@ -78,6 +81,7 @@ extern NSString *kHelperIdentifierArgumentPrefix; [listener invalidate]; listener = nil; } +#endif [cn setInvalidationHandler:nil]; [cn invalidate];