RESOLVED FIXED147793
Post-review comments on r188146
https://bugs.webkit.org/show_bug.cgi?id=147793
Summary Post-review comments on r188146
Myles C. Maxfield
Reported 2015-08-07 14:01:50 PDT
Post-review comments on r188146
Attachments
Patch (10.75 KB, patch)
2015-08-07 14:03 PDT, Myles C. Maxfield
dbates: review+
Myles C. Maxfield
Comment 1 2015-08-07 14:03:48 PDT
Daniel Bates
Comment 2 2015-08-07 14:39:48 PDT
Comment on attachment 258526 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=258526&action=review > Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp:55 > + return originalFont; Take originalFont to be non-null and features to be null. Then this will cause a memory leak because on return from this function the originalFont will have a retain count of 2. Assuming you like the design of having a non void return type for this function, one way to prevent this is to change the data type of originalFont from CTFontRef to RetainPtr<CTFontRef>. > Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp:60 > + appendTrueTypeFeature(featureArray.get(), (*features)[i]); > + appendOpenTypeFeature(featureArray.get(), (*features)[i]); Is there a better way to write (*features)[i]? One idea is to rename the argument features to featuresPtr and then define a local variable, features, that is constant lvalue reference to FontFeatureSettings after line 55. Then write the remaining code for this function in terms of features.
Daniel Bates
Comment 3 2015-08-07 14:51:26 PDT
(In reply to comment #2) > Comment on attachment 258526 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=258526&action=review > > > Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp:55 > > + return originalFont; > > [...] Then this will > cause a memory leak because on return from this function the originalFont > will have a retain count of 2. Disregard this remark. It will not leak. Though it will ref-count churn :/
Myles C. Maxfield
Comment 4 2015-08-07 14:55:33 PDT
Note You need to log in before you can comment on or make changes to this bug.