Просмотр исходного кода

Fix crash surrounding SwiftObject subclasses

SwiftObject subclasses cannot be safely inspected with the Objc runtime, attempts to do so sometimes lead to crashes
Tanner Bennett лет назад: 7
Родитель
Сommit
44e9d55fb8
1 измененных файлов с 5 добавлено и 0 удалено
  1. 5 0
      Classes/GlobalStateExplorers/FLEXInstancesTableViewController.m

+ 5 - 0
Classes/GlobalStateExplorers/FLEXInstancesTableViewController.m

@@ -79,6 +79,11 @@
 {
 {
     NSMutableArray<FLEXObjectRef *> *instances = [NSMutableArray array];
     NSMutableArray<FLEXObjectRef *> *instances = [NSMutableArray array];
     [FLEXHeapEnumerator enumerateLiveObjectsUsingBlock:^(__unsafe_unretained id tryObject, __unsafe_unretained Class actualClass) {
     [FLEXHeapEnumerator enumerateLiveObjectsUsingBlock:^(__unsafe_unretained id tryObject, __unsafe_unretained Class actualClass) {
+        // Skip Swift objects
+        if ([actualClass isKindOfClass:NSClassFromString(@"SwiftObject")]) {
+            return;
+        }
+        
         // Get all the ivars on the object. Start with the class and and travel up the inheritance chain.
         // Get all the ivars on the object. Start with the class and and travel up the inheritance chain.
         // Once we find a match, record it and move on to the next object. There's no reason to find multiple matches within the same object.
         // Once we find a match, record it and move on to the next object. There's no reason to find multiple matches within the same object.
         Class tryClass = actualClass;
         Class tryClass = actualClass;