RESOLVED FIXED 190818
Fix false positive leaks when using custom -init methods that don't start with -init
https://bugs.webkit.org/show_bug.cgi?id=190818
Summary Fix false positive leaks when using custom -init methods that don't start wit...
David Kilzer (:ddkilzer)
Reported 2018-10-22 21:17:05 PDT
Fix false positive leaks when using custom -init methods that don't start with -init. <rdar://problem/45476042>
Attachments
Patch v1 (3.81 KB, patch)
2018-10-22 21:24 PDT, David Kilzer (:ddkilzer)
mitz: review+
ddkilzer: commit-queue-
David Kilzer (:ddkilzer)
Comment 1 2018-10-22 21:24:48 PDT
Created attachment 352953 [details] Patch v1
mitz
Comment 2 2018-10-23 10:25:04 PDT
Comment on attachment 352953 [details] Patch v1 View in context: https://bugs.webkit.org/attachment.cgi?id=352953&action=review > Source/WebKitLegacy/mac/Misc/WebKitErrorsPrivate.h:65 > +- (id)_webkit_initWithDomain:(NSString *)domain code:(int)code URL:(NSURL *)URL __attribute__((objc_method_family(init))); Can you add this declaration to a class extension in the .m file instead of the private @interface in the header file? There’s no reason to expose this internal detail in a header.
David Kilzer (:ddkilzer)
Comment 3 2018-10-23 12:18:06 PDT
Comment on attachment 352953 [details] Patch v1 View in context: https://bugs.webkit.org/attachment.cgi?id=352953&action=review >> Source/WebKitLegacy/mac/Misc/WebKitErrorsPrivate.h:65 >> +- (id)_webkit_initWithDomain:(NSString *)domain code:(int)code URL:(NSURL *)URL __attribute__((objc_method_family(init))); > > Can you add this declaration to a class extension in the .m file instead of the private @interface in the header file? There’s no reason to expose this internal detail in a header. Will do. The reason I didn't is that adding this to the WebKitErrors.m file complained about declaring the category twice: @interface NSError (WebKitExtras) - (id)_webkit_initWithDomain:(NSString *)domain code:(int)code URL:(NSURL *)URL __attribute__((objc_method_family(init))); @end I can always do this instead: @interface NSError () - (id)_webkit_initWithDomain:(NSString *)domain code:(int)code URL:(NSURL *)URL __attribute__((objc_method_family(init))); @end But my OCD didn't want to leave the method implemented inside: @implementation NSError (WebKitExtras) @end I guess I'll just add a separate implementation category.
David Kilzer (:ddkilzer)
Comment 4 2018-10-23 13:36:53 PDT
Note You need to log in before you can comment on or make changes to this bug.