diff options
Diffstat (limited to 'src/google/protobuf/generated_message_util.h')
-rw-r--r-- | src/google/protobuf/generated_message_util.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/google/protobuf/generated_message_util.h b/src/google/protobuf/generated_message_util.h index 871acca5..8dc64c49 100644 --- a/src/google/protobuf/generated_message_util.h +++ b/src/google/protobuf/generated_message_util.h @@ -84,6 +84,12 @@ class ExplicitlyConstructed { } bool IsInitialized() { return init_; } + void Shutdown() { + if (init_) { + init_ = false; + get_mutable()->~T(); + } + } const T& get() const { return reinterpret_cast<const T&>(union_); } T* get_mutable() { return reinterpret_cast<T*>(&union_); } |