Flutter Engine
The Flutter Engine
AutoreleasePool.h
Go to the documentation of this file.
1/*
2 * Copyright 2019 Google LLC
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#ifndef SkAutoreleasePool_DEFINED
9#define SkAutoreleasePool_DEFINED
10
11/*
12 * Helper class for managing an autorelease pool for Metal. On other platforms this will
13 * do nothing so there's no need to #ifdef it out.
14 */
15#if defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_IOS)
16class AutoreleasePool {
17public:
20
21 void drain();
22
23private:
24 void* fPool;
25};
26#else
28public:
30 ~AutoreleasePool() = default;
31
32 void drain() {}
33};
34#endif
35
36#endif
~AutoreleasePool()=default