Skip to content

Commit

Permalink
ASTextKitComponents needs to be deallocated on main (#598)
Browse files Browse the repository at this point in the history
  • Loading branch information
maicki authored and nguyenhuy committed Oct 4, 2017
1 parent 7a07d9e commit dd90978
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Source/Private/ASInternalHelpers.m
Expand Up @@ -91,6 +91,7 @@ void ASPerformBackgroundDeallocation(id object)

BOOL ASClassRequiresMainThreadDeallocation(Class c)
{
// Specific classes
if (c == [UIImage class] || c == [UIColor class]) {
return NO;
}
Expand All @@ -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;
}
Expand Down

0 comments on commit dd90978

Please sign in to comment.