-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Dispose device after using in ImageCropper.Helpers.cs #3283
Conversation
Dispose device after using in ImageCropper.Helpers.cs
Thanks JasonStein for opening a Pull Request! The reviewers will test the PR and highlight if there is any conflict or changes required. If the PR is approved we will proceed to merge the pull request 🙌 |
@Kyaa-dost can you do a sanity check and just try out the Image Cropper in the Sample App with this PR applied? Thanks! |
@Jasonstein I have tried to build this multiple times in different machines and I keep receiving the same error. Can you please verify on your end and see if you can reproduce this? |
@Kyaa-dost I don't think this error is related to this PR, are you seeing this error in Master branch as well? I can do a check later today. @michael-hawker thoughts? |
@Jasonstein It was only occurring for this PR earlier but now seems to be consistent with others as well. Please disregard the error. I will try to fix the error as I am receiving this in different machines. |
|
We currently use the shared CanvasDevice in 5 different files. What happens when you place an Eyedropper and a RadialGradientBrush on the same page as the ImageCropper? |
@Kyaa-dost sorry, you're build issue isn't related to this PR. It's an SDK issue we hit with something introduced in another PR. We're fixing it to make this not a hassle for others at the moment in #3298. I'm going to look at that PR soon and get it merged. |
Need to re-check based on other review comment
@skendrot thanks for that catch Shawn! That's a good question, should be easy enough to drop them all on a page together in the sample app and test. @Jasonstein thoughts? |
Yes, also I think as soon as we are not using the shared device across different component at same time, we should be fine. But yes, if that's the case, we better just keep it and let GC do the work when necessary. We should do test anyway to verify first. |
@michael-hawker correct, based on the troubleshooting and the issue opened by Sergio, SDK19041 seems to do the job and using it as a workaround 🙂 |
@Kyaa-dost Beware though that just using the 19041 SDK still doesn't solve all issues 😢 |
@michael-hawker @Jasonstein The test looks good and performing fine. We can now proceed with @skendrot idea mentioned above or discuss further. If anyone else wants to test it out please feel free to try the sample App. |
Regarding what @skendrot said from the docs, wouldn't this change potentially affect the Not sure we should really be using a |
@Sergio0694 yeah, I agree. I think the consensus is based on the docs, we just grab the Shared Device and let the GC handle things as needed. @Jasonstein you good with us just closing this PR? |
Yes, please close it. I don't have any concerns. |
Dispose device after using in ImageCropper.Helpers.cs since CanvasDevice is disposble.
https://microsoft.github.io/Win2D/html/M_Microsoft_Graphics_Canvas_CanvasDevice_Dispose.htm
PR Type
What kind of change does this PR introduce?
Refactoring?
What is the new behavior?
PR Checklist
Please check if your PR fulfills the following requirements: