blob: 6116115c11fe2f37808c06e88b40f8ab58a579c0 [file] [log] [blame]
/*
* Copyright 2019 Google LLC
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "include/core/SkTypes.h"
#include "tools/AutoreleasePool.h"
#import <Foundation/NSAutoreleasePool.h>
AutoreleasePool::AutoreleasePool() {
fPool = (void*)[[NSAutoreleasePool alloc] init];
}
AutoreleasePool::~AutoreleasePool() {
[(NSAutoreleasePool*)fPool release];
fPool = nullptr;
}
void AutoreleasePool::drain() {
[(NSAutoreleasePool*)fPool drain];
fPool = (void*)[[NSAutoreleasePool alloc] init];
}