add copy constructor and assignment operator to ensure proper initialization of refcount.
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Thu, 10 Apr 2008 12:59:15 -0700
changeset 2946 14194a052b7d
parent 2945 8e9f4dc59d8b
child 2947 b0fec3381418
add copy constructor and assignment operator to ensure proper initialization of refcount.
src/core/ref-count-base.cc
src/core/ref-count-base.h
--- a/src/core/ref-count-base.cc	Thu Apr 10 12:24:36 2008 -0700
+++ b/src/core/ref-count-base.cc	Thu Apr 10 12:59:15 2008 -0700
@@ -30,6 +30,15 @@
 {
 }
 
+RefCountBase::RefCountBase (const RefCountBase &o)
+ : m_count (1)
+{}
+RefCountBase &
+RefCountBase::operator = (const RefCountBase &o)
+{
+  return *this;
+}
+
 RefCountBase::~RefCountBase () 
 {
 }
--- a/src/core/ref-count-base.h	Thu Apr 10 12:24:36 2008 -0700
+++ b/src/core/ref-count-base.h	Thu Apr 10 12:59:15 2008 -0700
@@ -41,6 +41,8 @@
 { 
 public:
   RefCountBase();
+  RefCountBase (const RefCountBase &o);
+  RefCountBase &operator = (const RefCountBase &o);
   virtual ~RefCountBase ();
   /**
    * Increment the reference count. This method should not be called