Open xiabob opened 7 years ago
@xiabob where do you think weak self should be used? Do you want to submit a pull request for this?
__weak __typeof(self)weakSelf = self;
ctx[@"contentUpdateCallback"] = ^(JSValue *msg) {
if (weakSelf.receiveEditorDidChangeEvents) {
[weakSelf editorDidChangeWithText:[weakSelf getText] andHTML:[weakSelf getHTML]];
}
[weakSelf checkForMentionOrHashtagInText:[weakSelf getText]];
};
try this,it works for me.is three a retain cycle here?
@xiabob I will try your solution.
@xiabob I have just tried your solution and it is not working.
@william205 Thank you for your reply, my question is this:
but check with instruments, no leak happened
why these happened?
[contentController addScriptMessageHandler:self name:@"jsm"]; cause leak
ZSSRichTextEditor.m line1706 /*
maybe you should use weak self here