Permalink
Browse files

RCTManagedPointer fix ups

Reviewed By: javache

Differential Revision: D5727367

fbshipit-source-id: ef6c03e57ee0c40da9411c77f0e8a733945afa07
  • Loading branch information...
fromcelticpark authored and facebook-github-bot committed Sep 1, 2017
1 parent 3ab973e commit 77c11e831b3c020619af0fcd9e56a9b94c3671ff
Showing with 14 additions and 7 deletions.
  1. +14 −7 React/Base/RCTManagedPointer.h
@@ -7,6 +7,8 @@
* of patent rights can be found in the PATENTS file in the same directory.
*/
#ifdef __cplusplus
#include <memory>
#import <Foundation/Foundation.h>
@@ -24,11 +26,16 @@
@end
namespace RCT {
template <typename T, typename P>
RCTManagedPointer *managedPointer(P initializer)
{
auto ptr = std::shared_ptr<void>(new T((NSDictionary *)initializer));
return [[RCTManagedPointer alloc] initWithPointer:std::move(ptr)];
}
namespace facebook {
namespace react {
template <typename T, typename P>
RCTManagedPointer *managedPointer(P initializer)
{
auto ptr = std::shared_ptr<void>(new T(initializer));
return [[RCTManagedPointer alloc] initWithPointer:std::move(ptr)];
}
} }
#endif

0 comments on commit 77c11e8

Please sign in to comment.