This repository was archived by the owner on May 28, 2025. It is now read-only.
Fix infinite loop in __CreateDWriteTextLayout#1306
Merged
Conversation
msft-Jeyaram
reviewed
Nov 2, 2016
| CFRelease(firstFrame); | ||
| CFRelease(secondFrame); | ||
| CFRelease(thirdFrame); | ||
| CFRelease(fullFrame); |
Contributor
Author
There was a problem hiding this comment.
A good pattern for future tests, but I don't believe it's necessary here
ms-jihua
reviewed
Nov 2, 2016
| NSDictionary* attribs = [static_cast<NSAttributedString*>(string) attributesAtIndex:i + range.location | ||
| longestEffectiveRange:&attributeRange | ||
| inRange:{ i, [subString length] }]; | ||
| inRange:{ i + range.location, [subString length] }]; |
Contributor
There was a problem hiding this comment.
inRange:{ i + range.location, [subString length] }]; [](start = 84, length = 52)
Mm. This is kind of a big ask, but in retrospect, I would prefer if you relied on [NSAttributedString enumerateAttributesInRange:options:usingBlock:] to do the loop instead. You're a lot less likely to make a mistake that way. (Note that you'd have to declare incompatibleAttributeFlag and textLayout as __block if you do this) #WontFix
Contributor
Author
There was a problem hiding this comment.
I'll do this the next time I add an attribute we handle here or on any cleanup pass I make.
Contributor
|
|
rajsesh
approved these changes
Nov 3, 2016
Contributor
|
@aballway is this ready to merge? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Were not handling edge case where frames were being created with ranges not aligned with attributes in attributed strings.
Fixes #1294
This change is