From de09f6e3b839e9ed35c6ea06954bf4c160403bc4 Mon Sep 17 00:00:00 2001 From: "Leaf Shi (BEYONDSOFT CONSULTING INC)" Date: Wed, 29 Jul 2026 23:46:12 -0700 Subject: [PATCH] Fix PictureBox frame callback handle race in OnFrameChanged --- .../System/Windows/Forms/Controls/PictureBox/PictureBox.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/System.Windows.Forms/System/Windows/Forms/Controls/PictureBox/PictureBox.cs b/src/System.Windows.Forms/System/Windows/Forms/Controls/PictureBox/PictureBox.cs index 976865fd5a8..f9dc5d41b99 100644 --- a/src/System.Windows.Forms/System/Windows/Forms/Controls/PictureBox/PictureBox.cs +++ b/src/System.Windows.Forms/System/Windows/Forms/Controls/PictureBox/PictureBox.cs @@ -1050,7 +1050,7 @@ private void OnFrameChanged(object? o, EventArgs e) } // Handle should be created, before calling the BeginInvoke. - if (InvokeRequired && IsHandleCreated) + if (IsHandleCreated && InvokeRequired) { lock (_internalSyncObject) {