Browse Source

IOSAD-139 Empty sync queue when starting up.

IOSAD-139
Dirk Zimmermann 3 years ago
parent
commit
c160f8bcde
3 changed files with 18 additions and 0 deletions
  1. +5
    -0
      pEpObjCAdapter/PEPQueue.h
  2. +10
    -0
      pEpObjCAdapter/PEPQueue.m
  3. +3
    -0
      pEpObjCAdapter/PEPSync.m

+ 5
- 0
pEpObjCAdapter/PEPQueue.h View File

@ -22,4 +22,9 @@ typedef void (^deleteOp)(id);
- (void)purge:(deleteOp)del;
/**
Removes all objects from the queue.
*/
- (void)removeAllObjects;
@end

+ 10
- 0
pEpObjCAdapter/PEPQueue.m View File

@ -116,6 +116,16 @@
[_cond unlock];
}
- (void)removeAllObjects
{
[_cond lock];
[self.queue removeAllObjects];
[_cond signal];
[_cond unlock];
}
- (void)dealloc
{


+ 3
- 0
pEpObjCAdapter/PEPSync.m View File

@ -157,6 +157,9 @@ static __weak PEPSync *s_pEpSync;
- (void)startup
{
// Make sure queue is empty when we start.
[self.queue removeAllObjects];
[self assureMainSessionExists];
self.conditionLockForJoiningSyncThread = [[NSConditionLock alloc] initWithCondition:NO];


Loading…
Cancel
Save