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:
Adlai Holler
2018-06-15 10:15:25 -07:00
committed by GitHub
parent a4dd19d808
commit a11506564a
26 changed files with 67 additions and 79 deletions

View File

@@ -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);
}
}