CellFilters: Fix lifetime and notification issues from review

Three fixes from PR review on the data-filters refactor.

RimDataFilterInViewCollection::syncWithSource: avoid double-free on
project load when m_sourceCollection has not yet resolved. The first
pass deletes orphan wrappers but leaves them in the local snapshot;
the null-source branch then deleted them again. Replace the second
deletion with deleteChildren() on the wrapper field.

RimDataFilterInViewCollection::setSourceCollection: disconnect from
the previous source's filtersChanged signal before reassigning, so
edits to a previously-bound case no longer trigger spurious geometry
regen on this view.

RimEclipsePropertyFilter::fieldChangedByUi: always emit
triggerFilterChanged() after updating bounds and related fields.
Otherwise, when the property filter lives inside a combined filter
under a per-view RimEclipsePropertyFilterCollection, the combined
parent's auto-derived display name was never recomputed.
This commit is contained in:
Kristian Bendiksen committed 2026-05-15 08:37:46 +02:00
1 parent ddcfef736b
commit b15c8d383c
2 files changed
+4 -7

No files matched your search

@@ -59,6 +59,7 @@ void RimDataFilterInViewCollection::setSourceCollection( RimDataFilterCollection
{
if ( m_sourceCollection() == sourceCollection ) return;
if ( m_sourceCollection() ) m_sourceCollection()->filtersChanged.disconnect( this );
m_sourceCollection = sourceCollection;
connectSourceSignal();
syncWithSource();
@@ -92,9 +93,7 @@ void RimDataFilterInViewCollection::syncWithSource()
if ( !m_sourceCollection() )
{
m_wrappers.clearWithoutDelete();
for ( auto* w : existing )
delete w;
m_wrappers.deleteChildren();
updateConnectedEditors();
return;
}
@@ -201,10 +201,8 @@ void RimEclipsePropertyFilter::fieldChangedByUi( const caf::PdmFieldHandle* chan
updateIconState();
uiCapability()->updateConnectedEditors();
if ( auto* container = parentContainer() )
container->updateDisplayModelNotifyManagedViews( this );
else
triggerFilterChanged();
if ( auto* container = parentContainer() ) container->updateDisplayModelNotifyManagedViews( this );
triggerFilterChanged();
}
}