diff --git a/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTBlockGuard.h b/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTBlockGuard.h deleted file mode 100644 index 0e34516bedaa14..00000000000000 --- a/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTBlockGuard.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - * RCTBlockGuard is designed to be used with obj-c blocks to assist with manual deallocation of C++ resources - * tied to lifetime of a block. If C++ resources needs to be manually released at the end of block or when the block - * is deallocated, place the clean up code inside constructor and make sure the instance of the class is references in - * the block. - */ -@interface RCTBlockGuard : NSObject - -- (instancetype)initWithCleanup:(void (^)(void))cleanup; - -@end - -NS_ASSUME_NONNULL_END diff --git a/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTBlockGuard.mm b/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTBlockGuard.mm deleted file mode 100644 index c88429c67a8c53..00000000000000 --- a/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTBlockGuard.mm +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -#import "RCTBlockGuard.h" - -@implementation RCTBlockGuard { - void (^_cleanup)(void); -} - -- (instancetype)initWithCleanup:(void (^)(void))cleanup -{ - if (self = [super init]) { - _cleanup = cleanup; - } - - return self; -} - -- (void)dealloc -{ - _cleanup(); -} - -@end