fix: Re-install FP plugins on bundle reload (#684)

This commit is contained in:
Marc Rousavy 2021-12-30 11:38:54 +01:00 committed by GitHub
parent d96c5863c9
commit b72176fae9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 0 additions and 12 deletions

View File

@ -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

View File

@ -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.");

View File

@ -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.");