aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/descriptor.cc
diff options
context:
space:
mode:
authorGravatar Kenichiro IDA <ida.kenichiro@gmail.com>2015-12-16 02:05:03 +0900
committerGravatar Kenichiro IDA <ida.kenichiro@gmail.com>2015-12-17 01:46:48 +0900
commit894d18fba4e9920985e5d9d23391527b97893ca5 (patch)
tree9eee8b47effe7e4d01611f215a661e18fcd55380 /src/google/protobuf/descriptor.cc
parentdc633398af5c87e1fe1ffcedaebd697c4775c918 (diff)
Alter FileDescriptorTables::kEmpty to GetEmptyInstance()
Diffstat (limited to 'src/google/protobuf/descriptor.cc')
-rw-r--r--src/google/protobuf/descriptor.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/google/protobuf/descriptor.cc b/src/google/protobuf/descriptor.cc
index 9a1c6fe8..07a6ca22 100644
--- a/src/google/protobuf/descriptor.cc
+++ b/src/google/protobuf/descriptor.cc
@@ -560,7 +560,7 @@ class FileDescriptorTables {
~FileDescriptorTables();
// Empty table, used with placeholder files.
- static const FileDescriptorTables kEmpty;
+ inline static const FileDescriptorTables& GetEmptyInstance();
// -----------------------------------------------------------------
// Finding items.
@@ -665,7 +665,10 @@ FileDescriptorTables::FileDescriptorTables()
FileDescriptorTables::~FileDescriptorTables() {}
-const FileDescriptorTables FileDescriptorTables::kEmpty;
+inline const FileDescriptorTables& FileDescriptorTables::GetEmptyInstance() {
+ static const FileDescriptorTables kEmpty;
+ return kEmpty;
+}
void DescriptorPool::Tables::AddCheckpoint() {
checkpoints_.push_back(CheckPoint(this));
@@ -3535,7 +3538,7 @@ FileDescriptor* DescriptorBuilder::NewPlaceholderFile(
placeholder->package_ = &internal::GetEmptyString();
placeholder->pool_ = pool_;
placeholder->options_ = &FileOptions::default_instance();
- placeholder->tables_ = &FileDescriptorTables::kEmpty;
+ placeholder->tables_ = &FileDescriptorTables::GetEmptyInstance();
placeholder->source_code_info_ = &SourceCodeInfo::default_instance();
placeholder->is_placeholder_ = true;
placeholder->syntax_ = FileDescriptor::SYNTAX_PROTO2;