Skip to content

Commit

Permalink
Merge pull request #6517 from frenzibyte/ios-fix-threading-issues
Browse files Browse the repository at this point in the history
Fix iOS file presentation code not scheduled to main thread
  • Loading branch information
peppy authored Jan 31, 2025
2 parents 37e1475 + 2bcd26f commit 7774e64
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions osu.Framework.iOS/IOSGameHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,17 @@ protected override void SetupConfig(IDictionary<FrameworkSetting, object> defaul

public override Storage GetStorage(string path) => new IOSStorage(path, this);

public override bool OpenFileExternally(string filename) => presenter.OpenFile(filename);
public override bool OpenFileExternally(string filename)
{
UIApplication.SharedApplication.InvokeOnMainThread(() => presenter.OpenFile(filename));
return true;
}

public override bool PresentFileExternally(string filename) => presenter.PresentFile(filename);
public override bool PresentFileExternally(string filename)
{
UIApplication.SharedApplication.InvokeOnMainThread(() => presenter.PresentFile(filename));
return true;
}

public override void OpenUrlExternally(string url)
{
Expand Down

0 comments on commit 7774e64

Please sign in to comment.