Skip to content

Conversation

@brianpopow
Copy link
Collaborator

Prerequisites

  • I have written a descriptive pull-request title
  • I have verified that there are no overlapping pull-requests open
  • I have verified that I am following the existing coding patterns and practice as demonstrated in the repository. These follow strict Stylecop rules 👮.
  • I have provided test coverage for my change (where applicable) Not sure howto provide a test for this issue.

Description

This PR changes the disposing of the encodedAlphaData to be in a try/finally block instead of using statement.
This is related to Issue #2411

It will now be disposed in a try / finally block.
@brianpopow brianpopow linked an issue Mar 24, 2023 that may be closed by this pull request
5 tasks
@brianpopow brianpopow changed the title Dont use using statement for encodedAlphaData Webp: Dont use using statement for encodedAlphaData Mar 24, 2023
alphaData[..alphaDataSize],
this.alphaCompression && alphaCompressionSucceeded);
try
{
Copy link
Member

Choose a reason for hiding this comment

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

your going to want to start this try before the if (hasAlpha) line otherwise anything that fails before the WriteEncodedImageToStream line will cause the memory to leak

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

good point, changed with db3d748

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

System.ExecutionEngineException when trying to save image as webp

3 participants