Fix static method in file header (#29118)

Summary:
I have looked into recent commits and found a typical mistake when static is used in .h file.
Here static is not necessary. See link: https://stackoverflow.com/questions/780730/c-c-static-function-in-header-file-what-does-it-mean

## Changelog
Changelog: [Internal] Fabric-specific internal change.
Pull Request resolved: https://github.com/facebook/react-native/pull/29118

Reviewed By: sammy-SC

Differential Revision: D22039305

Pulled By: shergin

fbshipit-source-id: 7078e716166067dd1e94cbb84200a1235283c978
This commit is contained in:
Vitaly Potlov 2020-06-24 12:27:35 -07:00 коммит произвёл Facebook GitHub Bot
Родитель 6f99beff7e
Коммит 208e4d2dcd
2 изменённых файлов: 22 добавлений и 12 удалений

Просмотреть файл

@ -27,18 +27,7 @@ namespace detail {
* A custom deleter used for the deallocation of Objective-C managed objects. * A custom deleter used for the deallocation of Objective-C managed objects.
* To be used only by `wrapManagedObject`. * To be used only by `wrapManagedObject`.
*/ */
static void wrappedManagedObjectDeleter(void *cfPointer) noexcept void wrappedManagedObjectDeleter(void *cfPointer) noexcept;
{
// A shared pointer does call custom deleter on `nullptr`s.
// This is somewhat counter-intuitively but makes sense considering the type-erasured nature of shared pointer and an
// aliasing constructor feature. `CFRelease` crashes on null pointer though. Therefore we must check for this case
// explicitly.
if (cfPointer == NULL) {
return;
}
CFRelease(cfPointer);
}
} }

Просмотреть файл

@ -10,6 +10,27 @@
#if defined(__OBJC__) && defined(__cplusplus) #if defined(__OBJC__) && defined(__cplusplus)
#if TARGET_OS_MAC && TARGET_OS_IPHONE #if TARGET_OS_MAC && TARGET_OS_IPHONE
namespace facebook {
namespace react {
namespace detail {
void wrappedManagedObjectDeleter(void *cfPointer) noexcept
{
// A shared pointer does call custom deleter on `nullptr`s.
// This is somewhat counter-intuitively but makes sense considering the type-erasured nature of shared pointer and an
// aliasing constructor feature. `CFRelease` crashes on null pointer though. Therefore we must check for this case
// explicitly.
if (cfPointer == NULL) {
return;
}
CFRelease(cfPointer);
}
} // namespace detail
} // namespace react
} // namespace facebook
@implementation RCTInternalGenericWeakWrapper @implementation RCTInternalGenericWeakWrapper
@end @end