Fix issue that the slice button is still disabled after a tick is deleted (#2308)

Fix an UAF which causes the slice button being disabled after a tick is deleted
This commit is contained in:
Noisyfox 2023-10-03 11:03:19 -05:00 committed by GitHub
parent 85e24e62fa
commit 8e70081879
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -405,8 +405,9 @@ void IMSlider::add_code_as_tick(Type type, int selected_extruder)
}
void IMSlider::delete_tick(const TickCode& tick) {
Type t = tick.type; // Avoid Use-After-Free issue, which resets the tick.type to 0
m_ticks.ticks.erase(tick);
post_ticks_changed_event(tick.type);
post_ticks_changed_event(t);
}
bool IMSlider::check_ticks_changed_event(Type type)