Skip to content

fix(sensors_plus): isolate iOS stream handlers per engine - #3963

Open
FeliksLv01 wants to merge 1 commit into
fluttercommunity:mainfrom
FeliksLv01:fix/sensors-plus-ios-multi-engine
Open

fix(sensors_plus): isolate iOS stream handlers per engine#3963
FeliksLv01 wants to merge 1 commit into
fluttercommunity:mainfrom
FeliksLv01:fix/sensors-plus-ios-multi-engine

Conversation

@FeliksLv01

@FeliksLv01 FeliksLv01 commented Aug 24, 2026

Copy link
Copy Markdown

Description

Fixes the iOS lifecycle crash and cross-engine stream interference described in #3955.

The plugin now publishes an engine-owned instance and implements detachFromEngine(for:). Event channels and stream handlers are instance-owned, while each handler owns its CoreMotion object and event sink. Detaching one FlutterEngine therefore only stops that engine's streams; queued callbacks re-check the handler state before sending an event.

Related Issues

Checklist

  • I read the Contributor Guide and followed the required package-specific branch and PR workflow.
  • I titled the PR using Conventional Commits.
  • I did not modify the CHANGELOG.md nor the plugin version in pubspec.yaml files.
  • All existing and new tests are passing.
  • The analyzer does not report any problems on this PR.

Validation

  • flutter build ios --no-codesign --simulator --debug --target=lib/main.dart --dart-define=CI=true using Flutter 3.47.0.

Breaking Change

  • Yes, this is a breaking change.
  • No, this is not a breaking change.

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.

[Bug]: [sensors_plus] Termination crash fix from 1.3.3 is unreachable: plugin instance never published, detach hook has wrong selector

1 participant