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

NullPointerException on Application Exit #934

Closed
grigiada opened this issue Feb 14, 2023 · 4 comments
Closed

NullPointerException on Application Exit #934

grigiada opened this issue Feb 14, 2023 · 4 comments
Labels
bug Something isn't working priority 0 needs to be fixed asap. winui

Comments

@grigiada
Copy link

I performed the porting of a huge UWP project with LiveChart in WinUI 3 with LiveCharts2.
I followed your examples and I created all charts in ViewModel. When I perform the Application Exit command I intercept an NullPointerException (from SkiaSharp library).
Is it my fault? How can I solve this problem?

@torum
Copy link

torum commented Feb 16, 2023

I have the same issue and wondering the same thing. I get the following exception when I exit my WinUI3 app while chart is loading.

System.NullReferenceException
HResult=0x80004003
Message=Object reference not set to an instance of an object.
Source=SkiaSharp.Views.Windows
stack trace:
SkiaSharp.Views.Windows.SKXamlCanvas.Invalidate()

It's not a big deal since app would exit anyway but it would be nice to know how to avoid this.

@beto-rodriguez
Copy link
Owner

beto-rodriguez commented Jun 7, 2023

I have also seen this, it is strange that WinUI disposes the control, but the Invalidate method is still running.

This should be fixed with the referenced commit, now the control verifies if the canvas is still loaded in the UI.

This will be included in the next version of the library, thanks for the report!

@beto-rodriguez beto-rodriguez added bug Something isn't working winui priority 0 needs to be fixed asap. labels Jun 7, 2023
@daltzctr
Copy link

daltzctr commented Jun 9, 2023

Any chance you'd be able to publish a beta release with the fix?

@beto-rodriguez
Copy link
Owner

yes I am planning to release a new version to NuGet, I hope today or tomorrow is ready.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority 0 needs to be fixed asap. winui
Projects
None yet
Development

No branches or pull requests

4 participants