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" +} 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(); } }