mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2026-01-05 14:27:42 -07:00
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
2 changed files with 3 additions and 0 deletions
|
|
@ -308,6 +308,7 @@ ConfigOption* ConfigOptionDef::create_default_option() const
|
|||
opt->keys_map = this->enum_keys_map;
|
||||
return opt;
|
||||
}
|
||||
delete dft;
|
||||
}
|
||||
|
||||
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")) {
|
||||
auto colors = static_cast<ConfigOptionStrings *>(color_option->clone());
|
||||
m_presets_dirty |= m_initial_filament_presets_colors != colors->values;
|
||||
delete colors;
|
||||
}
|
||||
} else {
|
||||
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")) {
|
||||
auto colors = static_cast<ConfigOptionStrings *>(color_option->clone());
|
||||
m_initial_filament_presets_colors = colors->values;
|
||||
delete colors;
|
||||
}
|
||||
} else {
|
||||
m_initial_presets[type] = name;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue