From ad5b296b035e0bd5d0050b4f524ba8c3952f7885 Mon Sep 17 00:00:00 2001 From: Svyatoslav Scherbina Date: Thu, 10 Oct 2019 17:48:12 +0300 Subject: [PATCH] Disable "Only one Kotlin framework can be loaded currently" check since all implicit clashes were resolved. --- runtime/src/objc/cpp/ObjCExportClasses.mm | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/runtime/src/objc/cpp/ObjCExportClasses.mm b/runtime/src/objc/cpp/ObjCExportClasses.mm index 76dd5f7402b..b35936c3f48 100644 --- a/runtime/src/objc/cpp/ObjCExportClasses.mm +++ b/runtime/src/objc/cpp/ObjCExportClasses.mm @@ -133,8 +133,6 @@ extern "C" id objc_autoreleaseReturnValue(id self); @interface NSObject (NSObjectToKotlin) @end; -static void checkLoadedOnce(); - @implementation NSObject (NSObjectToKotlin) -(ObjHeader*)toKotlin:(ObjHeader**)OBJ_RESULT { RETURN_RESULT_OF(Kotlin_ObjCExport_convertUnmappedObjCObject, self); @@ -143,13 +141,6 @@ static void checkLoadedOnce(); -(void)releaseAsAssociatedObject { objc_release(self); } - -+(void)load { - static dispatch_once_t onceToken = 0; - dispatch_once(&onceToken, ^{ - checkLoadedOnce(); - }); -} @end; @interface NSString (NSStringToKotlin) @@ -212,16 +203,6 @@ OBJ_GETTER(Kotlin_boxDouble, KDouble value); } @end; -static void checkLoadedOnce() { - Class marker = objc_allocateClassPair([NSObject class], "KotlinFrameworkLoadedOnceMarker", 0); - if (marker == nullptr) { - [NSException raise:NSGenericException - format:@"Only one Kotlin framework can be loaded currently"]; - } else { - objc_registerClassPair(marker); - } -} - __attribute__((constructor)) static void injectToRuntime() { RuntimeCheck(Kotlin_ObjCExport_toKotlinSelector == nullptr, "runtime injected twice");