Skip to content

Commit

Permalink
ios: release memory from node-react messages
Browse files Browse the repository at this point in the history
Adds a nested auto release pool to release the messages sent from
node to react-native sooner.
  • Loading branch information
jaimecbernardo committed Jun 26, 2018
1 parent d356d70 commit fd958ed
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ios/NodeRunner.mm
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ void notifyNode(const char* msg)
}

void rcv_message(char* msg) {
NSString* objectiveCMessage=[NSString stringWithUTF8String:msg];
[[NodeRunner sharedInstance] sendMessageBackToReact:objectiveCMessage];
@autoreleasepool {
NSString* objectiveCMessage=[NSString stringWithUTF8String:msg];
[[NodeRunner sharedInstance] sendMessageBackToReact:objectiveCMessage];
}
}

@implementation NodeRunner
Expand Down

0 comments on commit fd958ed

Please sign in to comment.