fix: Re-install FP plugins on bundle reload (#684)
This commit is contained in:
parent
d96c5863c9
commit
b72176fae9
@ -18,6 +18,4 @@ typedef id (^FrameProcessorPlugin) (Frame* frame, NSArray<id>* arguments);
|
||||
+ (NSMutableDictionary<NSString*, FrameProcessorPlugin>*)frameProcessorPlugins;
|
||||
+ (void) addFrameProcessorPlugin:(NSString*)name callback:(FrameProcessorPlugin)callback;
|
||||
|
||||
+ (void) markInvalid;
|
||||
|
||||
@end
|
||||
|
@ -19,15 +19,7 @@
|
||||
return plugins;
|
||||
}
|
||||
|
||||
static BOOL _isValid = YES;
|
||||
+ (void) markInvalid {
|
||||
_isValid = NO;
|
||||
[[FrameProcessorPluginRegistry frameProcessorPlugins] removeAllObjects];
|
||||
}
|
||||
|
||||
+ (void) addFrameProcessorPlugin:(NSString*)name callback:(FrameProcessorPlugin)callback {
|
||||
NSAssert(_isValid, @"Tried to add Frame Processor Plugin but Frame Processor Registry has already registered all plugins!");
|
||||
|
||||
BOOL alreadyExists = [[FrameProcessorPluginRegistry frameProcessorPlugins] valueForKey:name] != nil;
|
||||
NSAssert(!alreadyExists, @"Tried to two Frame Processor Plugins with the same name! Either choose unique names, or remove the unused plugin.");
|
||||
|
||||
|
@ -107,8 +107,6 @@ __attribute__((objc_runtime_name("_TtC12VisionCamera10CameraView")))
|
||||
function));
|
||||
}
|
||||
|
||||
[FrameProcessorPluginRegistry markInvalid];
|
||||
|
||||
NSLog(@"FrameProcessorBindings: Frame Processor plugins installed!");
|
||||
#else
|
||||
NSLog(@"Reanimated not found, Frame Processors are disabled.");
|
||||
|
Loading…
Reference in New Issue
Block a user