mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-30 13:00:00 +00:00
Fixed DetachedBuffer self move assignment (#5521)
This commit is contained in:
committed by
Wouter van Oortmerssen
parent
2f5bb2eec4
commit
97f3aa9174
@@ -638,6 +638,9 @@ class DetachedBuffer {
|
|||||||
#if !defined(FLATBUFFERS_CPP98_STL)
|
#if !defined(FLATBUFFERS_CPP98_STL)
|
||||||
// clang-format on
|
// clang-format on
|
||||||
DetachedBuffer &operator=(DetachedBuffer &&other) {
|
DetachedBuffer &operator=(DetachedBuffer &&other) {
|
||||||
|
if (this == &other)
|
||||||
|
return *this;
|
||||||
|
|
||||||
destroy();
|
destroy();
|
||||||
|
|
||||||
allocator_ = other.allocator_;
|
allocator_ = other.allocator_;
|
||||||
|
|||||||
Reference in New Issue
Block a user