Improve RCTCxxBridge invalidation

Reviewed By: fromcelticpark

Differential Revision: D5536063

fbshipit-source-id: b0f19bebea839c7da84890c338ad4d38293bc99c
This commit is contained in:
Pieter De Baets
2017-09-11 04:24:29 -07:00
committed by Facebook Github Bot
parent 023ac57337
commit 7b770556ac
5 changed files with 72 additions and 63 deletions

View File

@@ -928,6 +928,10 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithBundleURL:(__unused NSURL *)bundleUR
{
RCTAssertJSThread();
if (!self.valid) {
return;
}
if (buffer != nil && buffer != (id)kCFNull) {
_wasBatchActive = YES;
[self handleBuffer:buffer];

View File

@@ -373,6 +373,8 @@ RCT_NOT_IMPLEMENTED(- (instancetype)init);
- (dispatch_queue_t)methodQueue
{
(void)[self instance];
RCTAssert(_methodQueue != nullptr, @"Module %@ has no methodQueue (instance: %@, bridge.valid: %d)",
self, _instance, _bridge.valid);
return _methodQueue;
}