Skip to content
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

Check video widget is mounted on call to setState #18467

Merged
merged 1 commit into from Jun 14, 2018

Conversation

cbracken
Copy link
Member

@cbracken cbracken commented Jun 14, 2018

When setState() calls occur asynchronously, it's possible that the
Futures on which they're waiting don't complete until the widget is
removed. To avoid this, we check the widget is mounted before calling
setState().

Fixes a devicelab test failure in test_driver/transitions_perf.dart

When setState() calls occur asynchronously, it's possible that the
Futures on which they're waiting don't complete until the widget is
offscreen. To avoid this, we check the widget is mounted before calling
setState().
@xster
Copy link
Member

xster commented Jun 14, 2018

LGTM

@cbracken
Copy link
Member Author

Fixes a devicelab test failure:

stdout: Starting application: test_driver/transitions_perf.dart
stderr: Could not find application bundle at build/ios/iphoneos/Runner.app; have you run "flutter build ios"?
stdout: Signing iOS app for device deployment using developer identity: "iPhone Developer: Google Development (3F4Y5873JF)"
stdout: Manually selecting Google's mobile provisioning profile (see go/google-flutter-signing).
stdout: [VERBOSE-2:dart_error.cc(16)] Unhandled exception:
stdout: 	NoSuchMethodError: The method 'markNeedsBuild' was called on null.
stdout: 	Receiver: null
stdout: 	Tried calling: markNeedsBuild()
stdout: 	#0      State.setState (package:flutter/src/widgets/framework.dart:1141)
stdout: 	#1      _VideoDemoState.initState.initController (package:flutter_gallery/demo/video_demo.dart:377)
stdout: 	
stdout: 	#2      _VideoDemoState.initState (package:flutter_gallery/demo/video_demo.dart:380)
stdout: 	#3      StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3751)
stdout: 	#4      ComponentElement.mount (package:flutter/src/widgets/framework.dart:3617)
stdout: 	#5      Element.inflateWidget (package:flutter/src/widgets/framework.dart:2907)

@xster
Copy link
Member

xster commented Jun 14, 2018

I'm gonna merge this on red to un-red the build

@xster xster merged commit 03b5b1c into flutter:master Jun 14, 2018
@Hixie
Copy link
Contributor

Hixie commented Jun 14, 2018

FWIW, this apparently did not fix the build.

@cbracken cbracken deleted the check-setstate branch June 14, 2018 18:34
srawlins added a commit to srawlins/flutter that referenced this pull request Jun 15, 2018
* master:
  Remove race conditions involving finding available ports (flutter#18488)
  Skip painting hidden children of a sliver list (flutter#18465)
  Fixed some typos (flutter#18516)
  update Tristate checkbox semantics to consider indeterminate as "unchecked" (flutter#18297)
  Add flutter tool support for creating app-specific VM snapshots. (flutter#18417)
  mention Text.rich on RichText (flutter#18434)
  invert children for real (flutter#18489)
  Fix clipping for SliverLists (flutter#18410)
  Keep TextFields visible when keyboard comes up (flutter#18291)
  Update all packages (flutter#18506)
  Prepare for upgrading video player in Gallery to newest version (flutter#18501)
  Update Android dependencies (flutter#18499)
  Enable running with prebuilt test-only apk (flutter#18453)
  Revert "Update all packages (flutter#18471)" (flutter#18492)
  Add some more dart doc to RepaintBoundary (flutter#17183)
  Update all packages (flutter#18471)
  Clean up output of "flutter run --release" (flutter#18380)
  Ensure errors launching emulators are exposed to the daemon (flutter#18446)
  Check video widget is mounted on call to setState (flutter#18467)
  Fixed concurrent list modification in vmservice.dart
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants