diff --git a/libs/pbd/pbd/property_list.h b/libs/pbd/pbd/property_list.h index 1711b2dd00..330345853f 100644 --- a/libs/pbd/pbd/property_list.h +++ b/libs/pbd/pbd/property_list.h @@ -57,6 +57,7 @@ public: * Defined below, once we have Property */ template bool add (PropertyDescriptor pid, const V& v); + template bool remove (PropertyDescriptor pid); protected: bool _property_owner; diff --git a/libs/pbd/pbd/property_list_impl.h b/libs/pbd/pbd/property_list_impl.h index 194042cf4c..b99f07236b 100644 --- a/libs/pbd/pbd/property_list_impl.h +++ b/libs/pbd/pbd/property_list_impl.h @@ -28,7 +28,13 @@ namespace PBD { template bool PropertyList::add (PropertyDescriptor pid, const V& v) { - return insert (value_type (pid.property_id, new Property (pid, (T)v))).second; + erase (pid.property_id); + return insert (value_type (pid.property_id, new Property (pid, (T)v))).second; +} + +template bool +PropertyList::remove (PropertyDescriptor pid) { + return erase (pid.property_id) > 0; } }