mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 14:45:21 +00:00
Reduce usage of autorelease pools (#968)
* Reduce reliance on the autorelease pool * changelog * A few more places * Use it in another place
This commit is contained in:
@@ -238,14 +238,12 @@ static void runLoopSourceCallback(void *info) {
|
||||
|
||||
- (void)drain
|
||||
{
|
||||
@autoreleasepool {
|
||||
_lock.lock();
|
||||
auto q = std::move(_queue);
|
||||
_lock.unlock();
|
||||
for (auto ref : q) {
|
||||
// NOTE: Could check that retain count is 1 and retry later if not.
|
||||
CFRelease(ref);
|
||||
}
|
||||
_lock.lock();
|
||||
auto q = std::move(_queue);
|
||||
_lock.unlock();
|
||||
for (auto ref : q) {
|
||||
// NOTE: Could check that retain count is 1 and retry later if not.
|
||||
CFRelease(ref);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user