Fix crash on Linux when switching between tabs in printer config (#6437)

* Fix crash due to the wrong window get returned in `PointCtrl` (SoftFever/OrcaSlicer#6261).
`getWindow()` must return the control itself, not its child control; otherwise the child control will be destroyed twice when the tab container is destroyed.

* Fix another crash on Linux caused by unused undo button
This commit is contained in:
Noisyfox 2024-08-18 16:30:45 +08:00 committed by GitHub
parent 01b16814ad
commit 4dd7d79d76
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 7 additions and 5 deletions

View file

@ -1944,6 +1944,7 @@ void PointCtrl::BUILD()
y_textctrl->Bind(wxEVT_KILL_FOCUS, ([this](wxEvent& e) { e.Skip(); propagate_value(y_textctrl); }), y_textctrl->GetId());
// // recast as a wxWindow to fit the calling convention
window = dynamic_cast<wxWindow*>(x_input);
sizer = dynamic_cast<wxSizer*>(temp);
x_textctrl->SetToolTip(get_tooltip_text(X+", "+Y));