Flutter Engine
The Flutter Engine
fml
platform
darwin
scoped_nsautorelease_pool.cc
Go to the documentation of this file.
1
// Copyright 2013 The Flutter Authors. All rights reserved.
2
// Use of this source code is governed by a BSD-style license that can be
3
// found in the LICENSE file.
4
5
#include "flutter/fml/platform/darwin/scoped_nsautorelease_pool.h"
6
7
#include <objc/message.h>
8
#include <objc/runtime.h>
9
10
namespace
{
11
typedef
id
(*msg_send)(
void
*, SEL);
12
}
// anonymous namespace
13
14
namespace
fml
{
15
16
ScopedNSAutoreleasePool::ScopedNSAutoreleasePool
() {
17
autorelease_pool_ =
reinterpret_cast<
msg_send
>
(objc_msgSend)(
18
objc_getClass(
"NSAutoreleasePool"
), sel_getUid(
"new"
));
19
}
20
21
ScopedNSAutoreleasePool::~ScopedNSAutoreleasePool
() {
22
reinterpret_cast<
msg_send
>
(objc_msgSend)(autorelease_pool_,
23
sel_getUid(
"drain"
));
24
}
25
26
}
// namespace fml
fml::ScopedNSAutoreleasePool::ScopedNSAutoreleasePool
ScopedNSAutoreleasePool()
Definition:
scoped_nsautorelease_pool.cc:16
fml::ScopedNSAutoreleasePool::~ScopedNSAutoreleasePool
~ScopedNSAutoreleasePool()
Definition:
scoped_nsautorelease_pool.cc:21
fml
Definition:
ascii_trie.cc:9
id
const uintptr_t id
Definition:
texture_unittests.cc:27
Generated on Sun Jun 23 2024 21:54:58 for Flutter Engine by
1.9.4