Skip to content

Release the GIL while UIKit runs the application - #91

Open
kattni wants to merge 2 commits into
beeware:mainfrom
kattni:codex/846-ios-launcher-gil
Open

kattni wants to merge 2 commits into
beeware:mainfrom
kattni:codex/846-ios-launcher-gil

Conversation

@kattni

@kattni kattni commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Release Python's GIL around UIApplicationMain, restoring the thread state on return or an Objective-C exception. Advertise sys._ios_app_main_releases_gil = True before importing app code so Rubicon can safely disable nesting. Refs beeware/rubicon-objc#846.

The complete fix requires this PR and beeware/rubicon-objc#847. Either component can be upgraded independently; only updating both disables nesting. No Toga or application code change is needed, but generated native launchers must be updated and rebuilt.

All four old/new Rubicon and launcher combinations passed the included simulator checks for nesting and prompt worker callbacks, as did a smoke test with unmodified Toga 0.5.7. Pre-commit passes; physical iPad trackpad validation remains outstanding.

PR Checklist:

  • I will abide by the BeeWare Code of Conduct
  • I have read and have followed the CONTRIBUTING.md file
  • This PR was generated or assisted using an AI tool

Assisted-by: OpenAI Codex

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant