Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Put Unlock method within the finally block to ensure that the Lock and Unlock methods are called in pairs #8157

Merged

Conversation

lindexi
Copy link
Member

@lindexi lindexi commented Aug 30, 2023

Fixes #8134

Description

The MILUtilities.MILCopyPixelBuffer may throw ArgumentException. We put Unlock method within the finally block to ensure that the Lock and Unlock methods are called in pairs

Customer Impact

See #8134

Regression

None.

Testing

Just CI and my demo

Risk

Normal.

Microsoft Reviewers: Open in CodeFlow

@lindexi lindexi requested a review from a team as a code owner August 30, 2023 02:09
@ghost ghost assigned lindexi Aug 30, 2023
@ghost ghost added the PR metadata: Label to tag PRs, to facilitate with triage label Aug 30, 2023
@ghost ghost requested review from dipeshmsft and singhashish-wpf August 30, 2023 02:09
@ghost ghost added the Community Contribution A label for all community Contributions label Aug 30, 2023
@miloush
Copy link
Contributor

miloush commented Aug 30, 2023

When does MILCopyPixelBuffer throw ArgumentException?

@lindexi
Copy link
Member Author

lindexi commented Aug 30, 2023

When does MILCopyPixelBuffer throw ArgumentException?

@miloush See #8134

Call the WriteableBitmap WritePixels with the error stride

@miloush
Copy link
Contributor

miloush commented Aug 30, 2023

LGTM

…edia/Imaging/WriteableBitmap.cs

Co-authored-by: Jan Kučera <10546952+miloush@users.noreply.github.com>
@ThomasGoulet73
Copy link
Contributor

LGTM

Copy link
Member

@Kuldeep-MS Kuldeep-MS left a comment

Choose a reason for hiding this comment

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

Looks Good To Me

@rchauhan18
Copy link
Contributor

Thanks @lindexi for the contribution.

@lindexi
Copy link
Member Author

lindexi commented Nov 6, 2023

Thank you @rchauhan18

@github-actions github-actions bot locked and limited conversation to collaborators Dec 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Community Contribution A label for all community Contributions PR metadata: Label to tag PRs, to facilitate with triage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WPF render thread will hangs when MILUtilities.MILCopyPixelBuffer throw ArgumentException
6 participants