better comment change
[ardour.git] / libs / pbd / id.cc
index ab9c7e73929e158b11c978dc88933ca60445a6d5..b96863b0fa7e13cec60a82f052e5260256c6f2ac 100644 (file)
@@ -38,7 +38,8 @@ uint64_t ID::_counter = 0;
 void
 ID::init ()
 {
-       counter_lock = new Glib::Mutex;
+       if (!counter_lock)
+               counter_lock = new Glib::Mutex;
 }
 
 ID::ID ()
@@ -47,6 +48,11 @@ ID::ID ()
        _id = _counter++;
 }
 
+ID::ID (const ID& other)
+{
+       _id = other._id;
+}
+
 ID::ID (string str)
 {
        string_assign (str);
@@ -84,6 +90,15 @@ ID::operator= (string str)
        return *this;
 }
 
+ID&
+ID::operator= (const ID& other)
+{
+       if (&other != this) {
+               _id = other._id;
+       }
+       return *this;
+}
+
 ostream&
 operator<< (ostream& ostr, const ID& _id)
 {