Skip to content

Fabric: Use std::move on callback in Element::stateData#29897

Closed
empyrical wants to merge 1 commit into
facebook:masterfrom
empyrical:element-move-callback
Closed

Fabric: Use std::move on callback in Element::stateData#29897
empyrical wants to merge 1 commit into
facebook:masterfrom
empyrical:element-move-callback

Conversation

@empyrical
Copy link
Copy Markdown
Contributor

Summary

This pull request adds a call to std::move on the lambda capture in Element::stateData.

On Windows/Visual Studio 2017, this fixes a failure in the test LayoutableShadowNodeTest.contentOriginOffset where the error std::bad_function_call was being thrown. This was narrowed down to the callback being empty when called in Element::stateData.

Making sure the callback survives with std::move allows that test to pass under Windows.

Changelog

[Internal] [Changed] - Fabric: Use std::move on callback in Element::stateData

Test Plan

The Fabric test suite passes on Windows after this change is made. I also tested it under macOS and Linux built with Clang and they both pass with this change made.

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Contributor A React Native contributor. labels Sep 8, 2020
@analysis-bot
Copy link
Copy Markdown

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 7,209,453 32
android hermes armeabi-v7a 6,858,625 32
android hermes x86 7,644,089 20
android hermes x86_64 7,535,033 24
android jsc arm64-v8a 9,369,050 -8
android jsc armeabi-v7a 9,010,350 -12
android jsc x86 9,231,770 -12
android jsc x86_64 9,808,922 4

Base commit: 7e89934

@analysis-bot
Copy link
Copy Markdown

Platform Engine Arch Size (bytes) Diff
ios - universal n/a --

Base commit: 7e89934

Copy link
Copy Markdown
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shergin has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@react-native-bot
Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @empyrical in c7ec600.

When will my fix make it into a release? | Upcoming Releases

@react-native-bot react-native-bot added the Merged This PR has been merged. label Sep 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Contributor A React Native contributor. Merged This PR has been merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants