-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Closed
Description
With dotnet/designs#139 and #39269, we are marking Thread.Abort() as Obsolete because it unconditionally throws PlatformNotSupportedException. The tests for the PR turned up that ImageAnimator.Unix.cs uses Thread.Abort() inside StopAnimate.
public static void StopAnimate(Image image, EventHandler onFrameChangedHandler)
{
if (image == null)
return;
if (ht.ContainsKey(image))
{
AnimateEventArgs evtArgs = (AnimateEventArgs)ht[image]!;
evtArgs.RunThread!.Abort();
ht.Remove(image);
}
}I am going to put a #pragma warning disable around the Thread.Abort() call, but this code would be unexpectedly throwing PNSE right now, which means it's either dead code or there's a lurking bug that no one has reported.
GSPP