IOSAD-89 explicity declaring ref as strong
authorDirk Zimmermann <dirk@pep-project.org>
Thu, 22 Mar 2018 11:05:12 +0100
changeset 550c6ac36a539f3
parent 549 a338e3afd9c2
child 551 6b7914602bc6
IOSAD-89 explicity declaring ref as strong
pEpObjCAdapter/PEPSessionProvider.m
     1.1 --- a/pEpObjCAdapter/PEPSessionProvider.m	Tue Mar 20 13:03:07 2018 +0100
     1.2 +++ b/pEpObjCAdapter/PEPSessionProvider.m	Thu Mar 22 11:05:12 2018 +0100
     1.3 @@ -39,17 +39,17 @@
     1.4  
     1.5      NSMutableDictionary<PEPCopyableThread*,PEPInternalSession*> *dict = [self sessionForThreadDict];
     1.6      PEPCopyableThread *currentThread = [[PEPCopyableThread alloc] initWithThread:[NSThread currentThread]];
     1.7 -    PEPInternalSession *session = dict[currentThread];
     1.8 -    if (!session) {
     1.9 -        session = [PEPInternalSession new];
    1.10 -        dict[currentThread] = session;
    1.11 +    PEPInternalSession * __strong newOrExistingSession = dict[currentThread];
    1.12 +    if (!newOrExistingSession) {
    1.13 +        newOrExistingSession = [PEPInternalSession new];
    1.14 +        dict[currentThread] = newOrExistingSession;
    1.15      }
    1.16 -    [self setConfigUnencryptedSubjectOnSession:session];
    1.17 +    [self setConfigUnencryptedSubjectOnSession:newOrExistingSession];
    1.18      [self nullifySessionsOfFinishedThreads];
    1.19  
    1.20      [[self sessionForThreadLock] unlock];
    1.21  
    1.22 -    return session;
    1.23 +    return newOrExistingSession;
    1.24  }
    1.25  
    1.26  + (void)cleanup