mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Fwk : Added DEBUG assert to detect when data is present in child fields
Added assert for ChildArrayField and ChildField
This commit is contained in:
parent
5e6fc505d0
commit
a86d24df97
@ -15,6 +15,13 @@ namespace caf
|
|||||||
template<typename DataType>
|
template<typename DataType>
|
||||||
PdmChildArrayField<DataType*>::~PdmChildArrayField()
|
PdmChildArrayField<DataType*>::~PdmChildArrayField()
|
||||||
{
|
{
|
||||||
|
#ifdef _DEBUG
|
||||||
|
for (size_t index = 0; index < m_pointers.size(); ++index)
|
||||||
|
{
|
||||||
|
assert(m_pointers.at(index).isNull());
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
this->removeThisAsParentField();
|
this->removeThisAsParentField();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,6 +52,10 @@ caf::PdmChildField<DataType*>::PdmChildField(const DataTypePtr& fieldValue)
|
|||||||
template<typename DataType >
|
template<typename DataType >
|
||||||
caf::PdmChildField<DataType*>::~PdmChildField()
|
caf::PdmChildField<DataType*>::~PdmChildField()
|
||||||
{
|
{
|
||||||
|
#ifdef _DEBUG
|
||||||
|
assert(m_fieldValue.isNull());
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!m_fieldValue.isNull()) m_fieldValue.rawPtr()->removeAsParentField(this);
|
if (!m_fieldValue.isNull()) m_fieldValue.rawPtr()->removeAsParentField(this);
|
||||||
m_fieldValue.setRawPtr(NULL);
|
m_fieldValue.setRawPtr(NULL);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user