mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
AppFwk: Improved the message when forgetting to delete a child object
This commit is contained in:
@@ -52,7 +52,8 @@ caf::PdmChildField<DataType*>::PdmChildField(const DataTypePtr& fieldValue)
|
|||||||
template<typename DataType >
|
template<typename DataType >
|
||||||
caf::PdmChildField<DataType*>::~PdmChildField()
|
caf::PdmChildField<DataType*>::~PdmChildField()
|
||||||
{
|
{
|
||||||
assert(m_fieldValue.isNull());
|
bool The_object_owned_by_the_child_field_is_deleted = m_fieldValue.isNull();
|
||||||
|
assert(The_object_owned_by_the_child_field_is_deleted); // Did you forget ?
|
||||||
|
|
||||||
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);
|
||||||
|
|||||||
Reference in New Issue
Block a user