fixed errors
This commit is contained in:
@@ -70,14 +70,17 @@ public:
|
||||
|
||||
// Implementations of Property methods
|
||||
void Object::RegisterProperty(PropertyBase* prop) {
|
||||
if (prop) d->m_Properties.push_back(prop);
|
||||
if (prop) {
|
||||
d->m_Properties.push_back(prop);
|
||||
}
|
||||
}
|
||||
|
||||
void Object::RegisterDynamicProperty(PropertyBase* prop) {
|
||||
if (prop) {
|
||||
for (auto* existing : d->m_DynamicProperties) {
|
||||
if (existing == prop) return;
|
||||
}
|
||||
d->m_DynamicProperties.push_back(prop);
|
||||
// Note: prop already added itself to m_Properties
|
||||
// during its own constructor call to owner->RegisterProperty()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,14 +120,12 @@ template void Object::serialize(Archive::log_archive &, const unsigned int);
|
||||
|
||||
Object::Object() : d(new ObjectPrivate) {
|
||||
d->m_SignalsBlocked = false;
|
||||
std::cout << "Object Constructor: created d=" << d << std::endl;
|
||||
}
|
||||
Object::Object(const Object ©) : d(new ObjectPrivate) {
|
||||
if (copy.d) {
|
||||
d->m_InstanceName = copy.d->m_InstanceName;
|
||||
d->m_SignalsBlocked = copy.d->m_SignalsBlocked;
|
||||
}
|
||||
std::cout << "Object CopyConstructor: created d=" << d << " from copy.d=" << copy.d << std::endl;
|
||||
}
|
||||
|
||||
Object& Object::operator=(const Object &other) {
|
||||
@@ -140,7 +141,6 @@ Object& Object::operator=(const Object &other) {
|
||||
}
|
||||
|
||||
Object::~Object() {
|
||||
std::cout << "Object Destructor: deleting d=" << d << " name=" << d->m_InstanceName << std::endl;
|
||||
for (auto* p : d->m_DynamicProperties) {
|
||||
delete p;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user