Permalink
Browse files

Don't enqueue another UI operation if we're already on the UI thread

Reviewed By: alexeylang

Differential Revision: D5085488

fbshipit-source-id: 0613c1403a67d63ad06ce2db9950d902f1c6473a
  • Loading branch information...
AaaChiuuu authored and facebook-github-bot committed May 21, 2017
1 parent 2bf512b commit 213ea30346ff85b6860320c9c6484fe304a6fc25
Showing with 1 addition and 7 deletions.
  1. +1 −7 ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java
@@ -105,13 +105,7 @@ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
mWasMeasured = true;
// Check if we were waiting for onMeasure to attach the root view.
if (mReactInstanceManager != null && !mIsAttachedToInstance) {
// Enqueue it to UIThread not to block onMeasure waiting for the catalyst instance creation.
UiThreadUtil.runOnUiThread(new Runnable() {
@Override
public void run() {
attachToReactInstanceManager();
}
});
attachToReactInstanceManager();
}
} finally {
Systrace.endSection(TRACE_TAG_REACT_JAVA_BRIDGE);

0 comments on commit 213ea30

Please sign in to comment.