mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
ASTextKitComponents needs to be deallocated on main (#598)
This commit is contained in:
committed by
Huy Nguyen
parent
7a07d9eb88
commit
dd90978fb6
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user