diff --git a/Libraries/Text/TextInput/RCTBackedTextInputDelegateAdapter.h b/Libraries/Text/TextInput/RCTBackedTextInputDelegateAdapter.h index d6d84239162e43..8c3555b50c400a 100644 --- a/Libraries/Text/TextInput/RCTBackedTextInputDelegateAdapter.h +++ b/Libraries/Text/TextInput/RCTBackedTextInputDelegateAdapter.h @@ -5,14 +5,15 @@ * LICENSE file in the root directory of this source tree. */ -#import "RCTBackedTextInputViewProtocol.h" -#import "RCTBackedTextInputDelegate.h" #import "../RCTTextUIKit.h" // TODO(macOS ISS#2323203) NS_ASSUME_NONNULL_BEGIN #pragma mark - RCTBackedTextFieldDelegateAdapter (for UITextField) +@protocol RCTBackedTextInputViewProtocol; // TODO(OSS Candidate ISS#2710739) +@protocol RCTBackedTextInputDelegate; // TODO(OSS Candidate ISS#2710739) + @interface RCTBackedTextFieldDelegateAdapter : NSObject - (instancetype)initWithTextField:(UITextField *)backedTextInputView; diff --git a/Libraries/Text/TextInput/RCTBackedTextInputDelegateAdapter.m b/Libraries/Text/TextInput/RCTBackedTextInputDelegateAdapter.m index d9aaf7fbf9eb1c..59a800b66587ad 100644 --- a/Libraries/Text/TextInput/RCTBackedTextInputDelegateAdapter.m +++ b/Libraries/Text/TextInput/RCTBackedTextInputDelegateAdapter.m @@ -6,6 +6,8 @@ */ #import "RCTBackedTextInputDelegateAdapter.h" +#import "RCTBackedTextInputViewProtocol.h" // TODO(OSS Candidate ISS#2710739) +#import "RCTBackedTextInputDelegate.h" // TODO(OSS Candidate ISS#2710739) #import "../RCTTextUIKit.h" // TODO(macOS ISS#2323203) #pragma mark - RCTBackedTextFieldDelegateAdapter (for UITextField) diff --git a/Libraries/Text/TextInput/Singleline/RCTUITextField.m b/Libraries/Text/TextInput/Singleline/RCTUITextField.m index 08fb76749b7c83..4c86eebc3ad1df 100644 --- a/Libraries/Text/TextInput/Singleline/RCTUITextField.m +++ b/Libraries/Text/TextInput/Singleline/RCTUITextField.m @@ -11,6 +11,7 @@ #import #import "RCTBackedTextInputDelegateAdapter.h" +#import "RCTBackedTextInputDelegate.h" // TODO(OSS Candidate ISS#2710739) #import "RCTTextAttributes.h" #if TARGET_OS_OSX // [TODO(macOS ISS#2323203) diff --git a/RNTester/RNTester.xcodeproj/project.pbxproj b/RNTester/RNTester.xcodeproj/project.pbxproj index 6ba93508ba4fd6..af9d0c04348345 100644 --- a/RNTester/RNTester.xcodeproj/project.pbxproj +++ b/RNTester/RNTester.xcodeproj/project.pbxproj @@ -915,6 +915,7 @@ 8385CF031B87479200C6273E /* RCTImageLoaderHelpers.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTImageLoaderHelpers.m; sourceTree = ""; }; 8385CF051B8747A000C6273E /* RCTImageLoaderHelpers.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RCTImageLoaderHelpers.h; sourceTree = ""; }; 9F1534BD233AB44F006DFE44 /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/JavaScriptCore.framework; sourceTree = DEVELOPER_DIR; }; + 9F1C4D00236CB06B0022EC0D /* RNTesterTestPlan_iOS.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = RNTesterTestPlan_iOS.xctestplan; sourceTree = ""; }; 9F5C1923230F46CB00E3E5A7 /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/JavaScriptCore.framework; sourceTree = DEVELOPER_DIR; }; 9FBFA513233C7E4C003D9A8D /* RNTesterBundle-macOS.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "RNTesterBundle-macOS.bundle"; sourceTree = BUILT_PRODUCTS_DIR; }; 9FBFA515233C7E4C003D9A8D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; @@ -1452,6 +1453,7 @@ 3D13F83F1D6F6AE000E69E0E /* RNTesterBundle */ = { isa = PBXGroup; children = ( + 9F1C4D00236CB06B0022EC0D /* RNTesterTestPlan_iOS.xctestplan */, 3D13F8401D6F6AE000E69E0E /* Info.plist */, 3D13F8441D6F6AF200E69E0E /* ImageInBundle.png */, 3D13F8451D6F6AF200E69E0E /* OtherImages.xcassets */, diff --git a/RNTester/RNTester.xcodeproj/xcshareddata/xcschemes/RNTester.xcscheme b/RNTester/RNTester.xcodeproj/xcshareddata/xcschemes/RNTester.xcscheme index 3e545b616a909d..2202cf9c8b5de0 100644 --- a/RNTester/RNTester.xcodeproj/xcshareddata/xcschemes/RNTester.xcscheme +++ b/RNTester/RNTester.xcodeproj/xcshareddata/xcschemes/RNTester.xcscheme @@ -1,7 +1,7 @@ + version = "1.7"> @@ -83,6 +83,21 @@ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" shouldUseLaunchSchemeArgsEnv = "YES"> + + + + + + + + @@ -110,17 +125,6 @@ - - - - - - - - { // TODO(OSS Candidate ISS#2710739) public: RCTMessageThread(NSRunLoop *runLoop, RCTJavaScriptCompleteBlock errorBlock); ~RCTMessageThread() override; diff --git a/React/CxxBridge/RCTMessageThread.mm b/React/CxxBridge/RCTMessageThread.mm index 5017bbb4e35fdc..b98d83e3bffcad 100644 --- a/React/CxxBridge/RCTMessageThread.mm +++ b/React/CxxBridge/RCTMessageThread.mm @@ -67,9 +67,10 @@ return; } - runAsync([this, func=std::make_shared>(std::move(func))] { - if (!m_shutdown) { - tryFunc(*func); + auto sharedThis = shared_from_this(); // TODO(OSS Candidate ISS#2710739): `this` can be deleted before the RunLoop executes the block as revealed by ASAN test runs. + runAsync([sharedThis, func=std::make_shared>(std::move(func))] { + if (sharedThis->m_shutdown == false) { + sharedThis->tryFunc(*func); } }); } @@ -78,9 +79,11 @@ if (m_shutdown) { return; } - runSync([this, func=std::move(func)] { - if (!m_shutdown) { - tryFunc(func); + + auto sharedThis = shared_from_this(); // TODO(OSS Candidate ISS#2710739): `this` can be deleted before the RunLoop executes the block as revealed by ASAN test runs. + runSync([sharedThis, func=std::move(func)] { + if (sharedThis->m_shutdown == false) { + sharedThis->tryFunc(func); } }); }