IOSAD-124 fixes: pepSession for main thread is nil_ed when called from main queue IOSAD-124
authorbuff <andreas@pep-project.org>
Sun, 21 Jul 2019 19:13:51 +0200
branchIOSAD-124
changeset 107534a6a20465e1
parent 1074 19e3a4f59580
child 1076 a44678f3cf7b
IOSAD-124 fixes: pepSession for main thread is nil_ed when called from main queue
pEpObjCAdapter/PEPSync.m
     1.1 --- a/pEpObjCAdapter/PEPSync.m	Sun Jul 21 18:39:19 2019 +0200
     1.2 +++ b/pEpObjCAdapter/PEPSync.m	Sun Jul 21 19:13:51 2019 +0200
     1.3 @@ -156,9 +156,7 @@
     1.4  
     1.5  - (void)startup
     1.6  {
     1.7 -    // assure the main session exists
     1.8 -    PEPInternalSession *session = [PEPSessionProvider session];
     1.9 -    session = nil;
    1.10 +    [self assureMainSessionExists];
    1.11  
    1.12      self.conditionLockForJoiningSyncThread = [[NSConditionLock alloc] initWithCondition:NO];
    1.13      NSThread *theSyncThread = [[NSThread alloc] initWithTarget:self
    1.14 @@ -186,6 +184,11 @@
    1.15      return s_pEpSync;
    1.16  }
    1.17  
    1.18 +- (void)assureMainSessionExists
    1.19 +{
    1.20 +    PEPInternalSession *session __attribute__((unused)) = [PEPSessionProvider session];
    1.21 +}
    1.22 +
    1.23  - (void)syncThreadLoop:(id)object
    1.24  {
    1.25      [self.conditionLockForJoiningSyncThread lock];