mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-27 15:41:00 -05:00
RimColorLegendCollection::deleteColorLegend erased the default-legend map entry before looking the legend up, so findDefaultLegendForResult always returned null and the old legend was never removed from m_customColorLegends. Each set_discrete_property_category_names call for the same property left an orphaned legend behind and appended a new one. Look up the legend before erasing the map key, and guard against deleting a standard legend that may have been registered as a default.