Obj-C potential leak in RNCryptor.m?

97 views
Skip to first unread message

Dimitri

unread,
May 21, 2017, 8:57:56 PM5/21/17
to rncryptor
Just looking at at obj-c implementation, file RNCryptor.m:


- (void)cleanupAndNotifyWithError:(NSError *)error

{

  self.error = error;

  self.finished = YES;

  if (self.handler) {

    dispatch_sync(self.responseQueue, ^{

      __weak typeof(self) weakSelf = self;

      self.handler(weakSelf, weakSelf.outData);

    });

    self.handler = nil;

  }

}



Shouldn't this be written like so:

- (void)cleanupAndNotifyWithError:(NSError *)error

{

  self.error = error;

  self.finished = YES;

  if (self.handler) {

    dispatch_sync(self.responseQueue, ^{

      __weak typeof(self) weakSelf = self;

      self.handler(weakSelf, weakSelf.outData);

    });

    self.handler = nil;

  }

}


Adil Hussain

unread,
Sep 20, 2017, 11:01:56 AM9/20/17
to rncryptor
Dmitri, what's the difference between the two blocks of code that you've pasted? They look identical to me.
Reply all
Reply to author
Forward
0 new messages