mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-14 08:45:52 +08:00
Added deallocation of wxBoxSizer into OptionsGroup::activate_line() when is not used.
This commit is contained in:
parent
bd644df2f7
commit
356bec6e5f
@ -338,10 +338,12 @@ void OptionsGroup::activate_line(Line& line)
|
|||||||
wxBOTTOM | wxTOP | (option.opt.full_width ? int(wxEXPAND) : int(wxALIGN_CENTER_VERTICAL)), (wxOSX || !staticbox) ? 0 : 2);
|
wxBOTTOM | wxTOP | (option.opt.full_width ? int(wxEXPAND) : int(wxALIGN_CENTER_VERTICAL)), (wxOSX || !staticbox) ? 0 : 2);
|
||||||
if (is_sizer_field(field))
|
if (is_sizer_field(field))
|
||||||
sizer->Add(field->getSizer(), 1, (option.opt.full_width ? int(wxEXPAND) : int(wxALIGN_CENTER_VERTICAL)), 0);
|
sizer->Add(field->getSizer(), 1, (option.opt.full_width ? int(wxEXPAND) : int(wxALIGN_CENTER_VERTICAL)), 0);
|
||||||
}
|
} else
|
||||||
|
delete sizer;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool sizer_is_used = false;
|
||||||
bool is_multioption_line = option_set.size() > 1;
|
bool is_multioption_line = option_set.size() > 1;
|
||||||
for (auto opt : option_set) {
|
for (auto opt : option_set) {
|
||||||
ConfigOptionDef option = opt.opt;
|
ConfigOptionDef option = opt.opt;
|
||||||
@ -356,8 +358,9 @@ void OptionsGroup::activate_line(Line& line)
|
|||||||
wxSize(sublabel_width != -1 ? sublabel_width * wxGetApp().em_unit() : -1, -1), wxALIGN_RIGHT);
|
wxSize(sublabel_width != -1 ? sublabel_width * wxGetApp().em_unit() : -1, -1), wxALIGN_RIGHT);
|
||||||
label->SetBackgroundStyle(wxBG_STYLE_PAINT);
|
label->SetBackgroundStyle(wxBG_STYLE_PAINT);
|
||||||
label->SetFont(wxGetApp().normal_font());
|
label->SetFont(wxGetApp().normal_font());
|
||||||
sizer_tmp->Add(label, 0, wxALIGN_CENTER_VERTICAL, 0);
|
sizer_tmp->Add(label, 0, wxALIGN_CENTER_VERTICAL, 0);
|
||||||
}
|
sizer_is_used = true;
|
||||||
|
}
|
||||||
|
|
||||||
// add field
|
// add field
|
||||||
const Option& opt_ref = opt;
|
const Option& opt_ref = opt;
|
||||||
@ -412,6 +415,9 @@ void OptionsGroup::activate_line(Line& line)
|
|||||||
if (!custom_ctrl)
|
if (!custom_ctrl)
|
||||||
sizer->Add(line.extra_widget_sizer, 0, wxLEFT | wxALIGN_CENTER_VERTICAL, 4); //! requires verification
|
sizer->Add(line.extra_widget_sizer, 0, wxLEFT | wxALIGN_CENTER_VERTICAL, 4); //! requires verification
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (custom_ctrl && !sizer_is_used)
|
||||||
|
delete sizer;
|
||||||
}
|
}
|
||||||
|
|
||||||
// create all controls for the option group from the m_lines
|
// create all controls for the option group from the m_lines
|
||||||
|
Loading…
x
Reference in New Issue
Block a user