Added reasons to assertions
This commit is contained in:
@ -132,7 +132,7 @@ namespace Dawn {
|
||||
// all the listeners on StateProperty<> that belong to this StateOwner
|
||||
// I need to keep track of what events I've subbed to, consuming more
|
||||
// memory, and I don't know if I actually need to do this or not.
|
||||
assertTrue(property.owner == this);
|
||||
assertTrue(property.owner == this, "StateOwner::useEffect: Property owner must be this StateOwner");
|
||||
}
|
||||
property._effectListners.push_back(fn);
|
||||
return fn;
|
||||
@ -156,7 +156,7 @@ namespace Dawn {
|
||||
if(property->owner == nullptr) {
|
||||
property->owner = this;
|
||||
} else {
|
||||
assertTrue(property->owner == this);
|
||||
assertTrue(property->owner == this, "StateOwner::useEffect: Property owner must be this StateOwner");
|
||||
}
|
||||
property->_effectListners.push_back(fn);
|
||||
++itProp;
|
||||
@ -177,7 +177,11 @@ namespace Dawn {
|
||||
const std::function<std::function<void()>()> &fn,
|
||||
IStateProperty &property
|
||||
) {
|
||||
if(property.owner == nullptr) { property.owner = this; } else { assertTrue(property.owner == this); }
|
||||
if(property.owner == nullptr) {
|
||||
property.owner = this;
|
||||
} else {
|
||||
assertTrue(property.owner == this, "StateOwner::useEffectWithTeardown: Property owner must be this StateOwner");
|
||||
}
|
||||
property._effectListnersWithTeardown.push_back(fn);
|
||||
|
||||
return std::bind([&](
|
||||
|
Reference in New Issue
Block a user