Flutter Engine
The Flutter Engine
fml
memory
weak_ptr_internal.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/memory/weak_ptr_internal.h"
6
7
#include "flutter/fml/logging.h"
8
9
namespace
fml
{
10
namespace
internal {
11
12
WeakPtrFlag::WeakPtrFlag
() : is_valid_(
true
) {}
13
14
WeakPtrFlag::~WeakPtrFlag
() {
15
// Should be invalidated before destruction.
16
FML_DCHECK
(!is_valid_);
17
}
18
19
void
WeakPtrFlag::Invalidate
() {
20
// Invalidation should happen exactly once.
21
FML_DCHECK
(is_valid_);
22
is_valid_ =
false
;
23
}
24
25
}
// namespace internal
26
}
// namespace fml
fml::internal::WeakPtrFlag::Invalidate
void Invalidate()
Definition:
weak_ptr_internal.cc:19
fml::internal::WeakPtrFlag::WeakPtrFlag
WeakPtrFlag()
Definition:
weak_ptr_internal.cc:12
fml::internal::WeakPtrFlag::~WeakPtrFlag
~WeakPtrFlag()
Definition:
weak_ptr_internal.cc:14
FML_DCHECK
#define FML_DCHECK(condition)
Definition:
logging.h:103
fml
Definition:
ascii_trie.cc:9
true
true
Definition:
verylargebitmap.cpp:163
Generated on Sun Jun 23 2024 21:54:58 for Flutter Engine by
1.9.4