From dd85b5dcf221b329b5eb48227759d3aa593d5e00 Mon Sep 17 00:00:00 2001 From: Andrew <30809111+acoates-ms@users.noreply.github.com> Date: Mon, 29 Apr 2024 09:37:02 -0700 Subject: [PATCH 1/2] Ensure D2D device context is not used outside Begin/End draw --- vnext/Microsoft.ReactNative.Cxx/AutoDraw.h | 1 + 1 file changed, 1 insertion(+) diff --git a/vnext/Microsoft.ReactNative.Cxx/AutoDraw.h b/vnext/Microsoft.ReactNative.Cxx/AutoDraw.h index d03904af2e4..342a1879376 100644 --- a/vnext/Microsoft.ReactNative.Cxx/AutoDraw.h +++ b/vnext/Microsoft.ReactNative.Cxx/AutoDraw.h @@ -20,6 +20,7 @@ class AutoDrawDrawingSurface { ~AutoDrawDrawingSurface() noexcept { if (m_d2dDeviceContext) { + m_d2dDeviceContext = nullptr; m_drawingSurfaceInterop->EndDraw(); } } From 072cefa8d341bb5924a7e52941fc9cf52011019b Mon Sep 17 00:00:00 2001 From: Andrew <30809111+acoates-ms@users.noreply.github.com> Date: Mon, 29 Apr 2024 09:37:27 -0700 Subject: [PATCH 2/2] Change files --- ...ative-windows-b9725ce8-aa24-4cc7-bb58-901190465ffc.json | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 change/react-native-windows-b9725ce8-aa24-4cc7-bb58-901190465ffc.json diff --git a/change/react-native-windows-b9725ce8-aa24-4cc7-bb58-901190465ffc.json b/change/react-native-windows-b9725ce8-aa24-4cc7-bb58-901190465ffc.json new file mode 100644 index 00000000000..7e3c7394033 --- /dev/null +++ b/change/react-native-windows-b9725ce8-aa24-4cc7-bb58-901190465ffc.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "Ensure D2D device context is not used outside Begin/End draw", + "packageName": "react-native-windows", + "email": "30809111+acoates-ms@users.noreply.github.com", + "dependentChangeType": "patch" +}