From: Michal Bloch Date: Wed, 18 Sep 2019 09:38:09 +0000 (+0200) Subject: Fix DetachedBuffer self move assignment X-Git-Tag: accepted/tizen/unified/20191101.042158~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=baba460bf65e66e62533d4a0c5e7dd7526a435ae;p=platform%2Fcore%2Fsystem%2Flibdbuspolicy.git Fix DetachedBuffer self move assignment Change-Id: I7d107ac767bbb9982bf773eca86f827fce8c6423 Signed-off-by: Michal Bloch --- diff --git a/src/internal/include/flatbuffers/flatbuffers.h b/src/internal/include/flatbuffers/flatbuffers.h index 8c87dff..8f5ae32 100644 --- a/src/internal/include/flatbuffers/flatbuffers.h +++ b/src/internal/include/flatbuffers/flatbuffers.h @@ -551,6 +551,9 @@ class DetachedBuffer { #if !defined(FLATBUFFERS_CPP98_STL) // clang-format on DetachedBuffer &operator=(DetachedBuffer &&other) { + if (this == &other) + return *this; + destroy(); allocator_ = other.allocator_;