From fabe2f209416d2fdfae9bc18b65f9166255df2ce Mon Sep 17 00:00:00 2001 From: ageay Date: Fri, 28 Jun 2013 08:21:34 +0000 Subject: [PATCH] Debug revealed with convertTo --- src/MEDCoupling/MEDCouplingRefCountObject.cxx | 9 +++++++++ src/MEDCoupling/MEDCouplingRefCountObject.hxx | 1 + 2 files changed, 10 insertions(+) diff --git a/src/MEDCoupling/MEDCouplingRefCountObject.cxx b/src/MEDCoupling/MEDCouplingRefCountObject.cxx index c8de20ea9..443ae2cd8 100644 --- a/src/MEDCoupling/MEDCouplingRefCountObject.cxx +++ b/src/MEDCoupling/MEDCouplingRefCountObject.cxx @@ -54,6 +54,15 @@ RefCountObject::RefCountObject(const RefCountObject& other):_cnt(1) { } +/*! + * Do nothing here ! It is not a bug ( I hope :) ) because all subclasses that + * copies using operator= should not copy the ref counter of \a other ! + */ +RefCountObject& RefCountObject::operator=(const RefCountObject& other) +{ + return *this; +} + bool RefCountObject::decrRef() const { bool ret=((--_cnt)==0); diff --git a/src/MEDCoupling/MEDCouplingRefCountObject.hxx b/src/MEDCoupling/MEDCouplingRefCountObject.hxx index 0eb1f4dea..c52e0aff0 100644 --- a/src/MEDCoupling/MEDCouplingRefCountObject.hxx +++ b/src/MEDCoupling/MEDCouplingRefCountObject.hxx @@ -67,6 +67,7 @@ namespace ParaMEDMEM void incrRef() const; virtual std::size_t getHeapMemorySize() const = 0; int getRCValue() const; + RefCountObject& operator=(const RefCountObject& other); protected: virtual ~RefCountObject(); private: -- 2.39.2