Skip to content

Fix dangling view - #6532

Open
JohnMcPMS wants to merge 1 commit into
microsoft:masterfrom
JohnMcPMS:fix-flaky-test
Open

JohnMcPMS wants to merge 1 commit into
microsoft:masterfrom
JohnMcPMS:fix-flaky-test

Conversation

@JohnMcPMS

@JohnMcPMS JohnMcPMS commented Sep 18, 2026

Copy link
Copy Markdown
Member

📖 Description

Fonts added a dynamic extension without changing the return from view to string.

Microsoft Reviewers: Open in CodeFlow

@JohnMcPMS
JohnMcPMS requested a review from a team as a code owner September 18, 2026 21:56

@ranm-msft ranm-msft left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified the lifetime problem rather than just the shape of the change: fileName.extension() hands back a temporary path, so the wstring_view built from its c_str() was already pointing at freed storage by the time the caller used it. Returning std::wstring and holding fileName by value closes both halves of that. The other branches were returning literals, so they were never at risk.

Nothing else from me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants