FIX: fix memleak related to config clone
JIRA: none, found by self test Signed-off-by: salt.wei <salt.wei@bambulab.com> Change-Id: Ifbab17d543c60a767c0a53e1bca7dfe77bd8fbec
This commit is contained in:
parent
92f2d8c37c
commit
e7c380b364
|
@ -308,6 +308,7 @@ ConfigOption* ConfigOptionDef::create_default_option() const
|
||||||
opt->keys_map = this->enum_keys_map;
|
opt->keys_map = this->enum_keys_map;
|
||||||
return opt;
|
return opt;
|
||||||
}
|
}
|
||||||
|
delete dft;
|
||||||
}
|
}
|
||||||
|
|
||||||
return this->default_value->clone();
|
return this->default_value->clone();
|
||||||
|
|
|
@ -35,6 +35,7 @@ void ProjectDirtyStateManager::update_from_presets()
|
||||||
if (ConfigOption *color_option = wxGetApp().preset_bundle->project_config.option("filament_colour")) {
|
if (ConfigOption *color_option = wxGetApp().preset_bundle->project_config.option("filament_colour")) {
|
||||||
auto colors = static_cast<ConfigOptionStrings *>(color_option->clone());
|
auto colors = static_cast<ConfigOptionStrings *>(color_option->clone());
|
||||||
m_presets_dirty |= m_initial_filament_presets_colors != colors->values;
|
m_presets_dirty |= m_initial_filament_presets_colors != colors->values;
|
||||||
|
delete colors;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
m_presets_dirty |= !m_initial_presets[type].empty() && m_initial_presets[type] != name;
|
m_presets_dirty |= !m_initial_presets[type].empty() && m_initial_presets[type] != name;
|
||||||
|
@ -66,6 +67,7 @@ void ProjectDirtyStateManager::reset_initial_presets()
|
||||||
if (ConfigOption *color_option = wxGetApp().preset_bundle->project_config.option("filament_colour")) {
|
if (ConfigOption *color_option = wxGetApp().preset_bundle->project_config.option("filament_colour")) {
|
||||||
auto colors = static_cast<ConfigOptionStrings *>(color_option->clone());
|
auto colors = static_cast<ConfigOptionStrings *>(color_option->clone());
|
||||||
m_initial_filament_presets_colors = colors->values;
|
m_initial_filament_presets_colors = colors->values;
|
||||||
|
delete colors;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
m_initial_presets[type] = name;
|
m_initial_presets[type] = name;
|
||||||
|
|
Loading…
Reference in New Issue