ASTextKitComponents needs to be deallocated on main (#598)

This commit is contained in:
Michael Schneider
2017-10-04 06:52:49 -07:00
committed by Huy Nguyen
parent 7a07d9eb88
commit dd90978fb6

View File

@@ -91,6 +91,7 @@ void ASPerformBackgroundDeallocation(id object)
BOOL ASClassRequiresMainThreadDeallocation(Class c)
{
// Specific classes
if (c == [UIImage class] || c == [UIColor class]) {
return NO;
}
@@ -101,10 +102,16 @@ BOOL ASClassRequiresMainThreadDeallocation(Class c)
return YES;
}
// Apple classes with prefix
const char *name = class_getName(c);
if (strncmp(name, "UI", 2) == 0 || strncmp(name, "AV", 2) == 0 || strncmp(name, "CA", 2) == 0) {
return YES;
}
// Specific Texture classes
if (strncmp(name, "ASTextKitComponents", 19) == 0) {
return YES;
}
return NO;
}