mirror of
https://github.com/godotengine/godot.git
synced 2026-01-06 10:11:57 +03:00
Merge pull request #18889 from madadam/async-await-fix
Set current SynchronizationContext before the game loop starts
This commit is contained in:
@@ -14,6 +14,7 @@ namespace Godot
|
||||
public GodotTaskScheduler()
|
||||
{
|
||||
Context = new GodotSynchronizationContext();
|
||||
SynchronizationContext.SetSynchronizationContext(Context);
|
||||
}
|
||||
|
||||
protected sealed override void QueueTask(Task task)
|
||||
@@ -57,7 +58,6 @@ namespace Godot
|
||||
|
||||
public void Activate()
|
||||
{
|
||||
SynchronizationContext.SetSynchronizationContext(Context);
|
||||
ExecuteQueuedTasks();
|
||||
Context.ExecutePendingContinuations();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user