nnhubbard / ZSSRichTextEditor

A beautiful rich text WYSIWYG editor for iOS with a syntax highlighted source view
MIT License
3.78k stars 584 forks source link

ZSSRichTextEditor line1758 内存泄露 #214

Open hangpuyan opened 6 years ago

hangpuyan commented 6 years ago

__block bool receiveEditorDidChangeEvents = _receiveEditorDidChangeEvents; weak typeof(self) weakSelf = self; JSContext ctx = [webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"]; ctx[@"contentUpdateCallback"] = ^(JSValue msg) { weak typeof(weakSelf) StrongSelf = weakSelf;

    if (receiveEditorDidChangeEvents) {

        [StrongSelf editorDidChangeWithText:[StrongSelf getText] andHTML:[StrongSelf getHTML]];

    }

    [StrongSelf checkForMentionOrHashtagInText:[StrongSelf getText]];

};