/* * 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 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]; }