X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/4b0aa1525597fd0800c4d00c6df3f3c49d53ee2c..4bcfd40036f842e976d329cd0cee7349b8e0f4d6:/src/mc/sosp/ChunkedData.hpp diff --git a/src/mc/sosp/ChunkedData.hpp b/src/mc/sosp/ChunkedData.hpp index c904a29f97..da5854efa8 100644 --- a/src/mc/sosp/ChunkedData.hpp +++ b/src/mc/sosp/ChunkedData.hpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2014-2018. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2014-2019. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ @@ -56,11 +56,13 @@ public: } ChunkedData& operator=(ChunkedData const& that) { - this->clear(); - store_ = that.store_; - pagenos_ = that.pagenos_; - for (std::size_t const& pageno : pagenos_) - store_->ref_page(pageno); + if (this != &that) { + this->clear(); + store_ = that.store_; + pagenos_ = that.pagenos_; + for (std::size_t const& pageno : pagenos_) + store_->ref_page(pageno); + } return *this; } ChunkedData& operator=(ChunkedData&& that)