Skip to content

Commit 43b3a17

Browse files
committed
Fix Lock misuses on SettingsPage
1 parent 6fc5d03 commit 43b3a17

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

CollapseLauncher/XAMLs/MainApp/Pages/SettingsPage.xaml.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2181,7 +2181,7 @@ private bool PerformSearch(string query)
21812181
return false;
21822182
}
21832183

2184-
lock (_highlightLock)
2184+
using (_highlightLock.EnterScope())
21852185
{
21862186
SettingsSearchBringIntoViewAndHighlight(firstControl);
21872187
_highlightCurrentIndex = 0;
@@ -2259,7 +2259,7 @@ private void SettingsSearchBox_OnLosingFocus(UIElement sender, LosingFocusEventA
22592259

22602260
private void SettingsSearchBoxFindSelectNext(object? sender, RoutedEventArgs? e)
22612261
{
2262-
lock (_highlightLock)
2262+
using (_highlightLock.EnterScope())
22632263
{
22642264
if (_highlightedControls.Count == 0)
22652265
{
@@ -2280,7 +2280,7 @@ private void SettingsSearchBoxFindSelectNext(object? sender, RoutedEventArgs? e)
22802280

22812281
private void SettingsSearchBoxFindSelectPrevious(object? sender, RoutedEventArgs? e)
22822282
{
2283-
lock (_highlightLock)
2283+
using (_highlightLock.EnterScope())
22842284
{
22852285
if (_highlightedControls.Count == 0)
22862286
{

0 commit comments

Comments
 (0)