From 09438c8c42ecb7635ffb86129a0098bd0cbf491a Mon Sep 17 00:00:00 2001 From: disarray2077 <86157825+disarray2077@users.noreply.github.com> Date: Sun, 1 Aug 2021 19:16:46 -0300 Subject: [PATCH] Fix stack overflow in DarkEditWidget --- BeefLibs/Beefy2D/src/theme/dark/DarkEditWidget.bf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/BeefLibs/Beefy2D/src/theme/dark/DarkEditWidget.bf b/BeefLibs/Beefy2D/src/theme/dark/DarkEditWidget.bf index 41cd7c18..b8175ffa 100644 --- a/BeefLibs/Beefy2D/src/theme/dark/DarkEditWidget.bf +++ b/BeefLibs/Beefy2D/src/theme/dark/DarkEditWidget.bf @@ -424,9 +424,9 @@ namespace Beefy.theme.dark if (selEnd > selStart) { - String selPrevString = scope String(selStart); + String selPrevString = new:ScopedAlloc! String(selStart); selPrevString.Append(sectionText, 0, selStart); - String selIncludeString = scope String(selEnd); + String selIncludeString = new:ScopedAlloc! String(selEnd); selIncludeString.Append(sectionText, 0, selEnd); float selStartX = GetTabbedWidth(selPrevString, curX); @@ -473,7 +473,7 @@ namespace Beefy.theme.dark if (isInside) { - String subText = scope String(mCursorTextPos - lineDrawStart); + String subText = new:ScopedAlloc! String(mCursorTextPos - lineDrawStart); subText.Append(sectionText, 0, mCursorTextPos - lineDrawStart); aX = GetTabbedWidth(subText, curX); } @@ -587,7 +587,7 @@ namespace Beefy.theme.dark if (char8Count < lineText.Length) { - String subString = scope String(char8Count); + String subString = new:ScopedAlloc! String(char8Count); subString.Append(lineText, 0, char8Count); float subWidth = GetTabbedWidth(subString, 0);