AvaloniaUI / Avalonia

Develop Desktop, Embedded, Mobile and WebAssembly apps with C# and XAML. The most popular .NET UI client technology
https://avaloniaui.net
MIT License
26.06k stars 2.25k forks source link

Throw ObjectDisposedException for ClipboardImpl/ClipboardDataObject #17472

Closed MrJul closed 2 weeks ago

MrJul commented 2 weeks ago

What does the pull request do?

This PR changes Avalonia.Native.ClipboardImpl and Avalonia.Native.ClipboardDataObject to throw ObjectDisposedException after they're disposed.

It also adds nullable annotations for this file.

What is the current behavior?

Using the objects after disposal results in a NullReferenceException.

avaloniaui-bot commented 2 weeks ago

You can test this PR using the following package version. 11.3.999-cibuild0053212-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]