mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 02:36:19 +02:00
[Settings]Fix crash caused by dangling thread (#35603)
* Fix crash caused by dangling thread * Fix process access to be able to WaitForSingleObject it
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
|
||||
using System;
|
||||
using System.Threading;
|
||||
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.UI.Dispatching;
|
||||
|
||||
namespace Microsoft.PowerToys.Settings.UI.Helpers
|
||||
@@ -14,7 +14,7 @@ namespace Microsoft.PowerToys.Settings.UI.Helpers
|
||||
public static void WaitForEventLoop(string eventName, Action callback)
|
||||
{
|
||||
var dispatcherQueue = DispatcherQueue.GetForCurrentThread();
|
||||
new Thread(() =>
|
||||
new Task(() =>
|
||||
{
|
||||
var eventHandle = new EventWaitHandle(false, EventResetMode.AutoReset, eventName);
|
||||
while (true)
|
||||
|
||||
Reference in New Issue
Block a user