Skip to content

Prevent possible race condition in NotifyAppControl #54

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 26, 2023

Conversation

swift-kim
Copy link
Member

AppControlManager is not thread-safe and may cause the following exception (reported by a third-party developer) when the UI thread (Dart code) is notified of an app control event (by NotifyAppControl) and tries to access the associated app control instance through NativeAttachAppControl before the instance is added to AppControlManager on the platform thread.

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Exception: Could not find an instance of AppControl with ID 1.
#0      new AppControl._fromMap (package:tizen_app_control/src/app_control.dart:88:7)
#1      new ReceivedAppControl._fromMap (package:tizen_app_control/src/app_control.dart:263:15)
#2      AppControl.onAppControl.<anonymous closure> (package:tizen_app_control/src/app_control.dart:141:50)
#3      _MapStream._handleData (dart:async/stream_pipe.dart:213:31)
#4      _ForwardingStreamSubscription._handleData (dart:async/stream_pipe.dart:153:13)
#5      _RootZone.runUnaryGuarded (dart:async/zone.dart:1594:10)

I'm not sure if this will fix the error. Let me just give it a try.

@swift-kim swift-kim merged commit c382987 into flutter-tizen:master Dec 26, 2023
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.

2 participants