Skip to content

Commit 057dad0

Browse files
authored
[0.84] Fix multiline TextInput crash from TxDrawD2D reentrancy (#15990) (#16005)
* Fix multiline TextInput crash from TxDrawD2D reentrancy * Change files
1 parent a54b3f9 commit 057dad0

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "prerelease",
3+
"comment": "Fix multiline TextInput crash from TxDrawD2D reentrancy",
4+
"packageName": "react-native-windows",
5+
"email": "74712637+iamAbhi-916@users.noreply.github.com",
6+
"dependentChangeType": "patch"
7+
}

vnext/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1775,7 +1775,10 @@ void WindowsTextInputComponentView::DrawText() noexcept {
17751775
}
17761776

17771777
// TODO keep track of proper invalid rect
1778+
// Prevent reentrancy: TxDrawD2D may call TxViewChange -> DrawText
1779+
m_cDrawBlock++;
17781780
auto hrDraw = m_textServices->TxDrawD2D(d2dDeviceContext, &rc, nullptr, TXTVIEW_ACTIVE);
1781+
m_cDrawBlock--;
17791782
winrt::check_hresult(hrDraw);
17801783

17811784
// draw placeholder text if needed

0 commit comments

Comments
 (0)