Skip to content

Commit

Permalink
ASTextKitComponents needs to be deallocated on main (TextureGroup#598)
Browse files Browse the repository at this point in the history
  • Loading branch information
maicki authored and bernieperez committed Apr 25, 2018
1 parent 8d13f4e commit 44db068
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Source/Private/ASInternalHelpers.m
Original file line number Diff line number Diff line change
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 44db068

Please sign in to comment.