diff --git a/core/reference.cpp b/core/reference.cpp index 6210764..8de3642 100644 --- a/core/reference.cpp +++ b/core/reference.cpp @@ -30,7 +30,8 @@ bool Reference::unreference() { return die; } -Reference::Reference() { +Reference::Reference() : + Object() { refcount.init(); refcount_init.init(); } diff --git a/core/resource.cpp b/core/resource.cpp index e129405..5535fcd 100644 --- a/core/resource.cpp +++ b/core/resource.cpp @@ -68,13 +68,13 @@ typedef std::vector > ResourceVector; \ return pp->setter(this, data); -#define RESOURCE_PROPERTY_ADD_IMPL(property_type, type_enum) \ +#define RESOURCE_PROPERTY_ADD_IMPL(property_type, type_enum) \ ResourceProperty, std::function > *prop = new ResourceProperty, std::function >(); \ - \ - prop->type = type_enum; \ - prop->getter = getter; \ - prop->setter = setter; \ - \ + \ + prop->type = type_enum; \ + prop->getter = getter; \ + prop->setter = setter; \ + \ _property_map[name] = prop; //Properties stuff end @@ -291,7 +291,8 @@ Resource::Resource() { register_properties(); } -Resource::~Resource() { +Resource::~Resource() : + Reference() { std::map::iterator it; for (it = _property_map.begin(); it != _property_map.end(); it++) {