-
Notifications
You must be signed in to change notification settings - Fork 500
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix warnings in Contacts module #4681
Conversation
@@ -196,21 +196,24 @@ - (void)searchWithPattern:(NSString *)searchText forceReset:(BOOL)forceRefresh h | |||
[hsUserDirectoryOperation cancel]; | |||
hsUserDirectoryOperation = nil; | |||
} | |||
|
|||
MXWeakify(self); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is weakifying and strongifying the right thing to do in this case as the request could have a longer lifetime than the data source which is holding a strong reference to it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's okay. MXStrongifyAndReturnIfNil
will return if the dataSource has been released in the meantime.
{ | ||
return; | ||
} | ||
MXStrongifyAndReturnIfNil(self); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems to me a Weakify/Strongify would have the same effect here, but flagging in case it doesn't.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me 👍
@@ -196,21 +196,24 @@ - (void)searchWithPattern:(NSString *)searchText forceReset:(BOOL)forceRefresh h | |||
[hsUserDirectoryOperation cancel]; | |||
hsUserDirectoryOperation = nil; | |||
} | |||
|
|||
MXWeakify(self); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's okay. MXStrongifyAndReturnIfNil
will return if the dataSource has been released in the meantime.
{ | ||
return; | ||
} | ||
MXStrongifyAndReturnIfNil(self); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Part of #4677.