You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
578 B
26 lines
578 B
4 months ago
|
/*
|
||
|
* 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];
|
||
|
}
|