GUI: fix crash when deleting current subsong

This commit is contained in:
tildearrow 2022-05-17 01:15:31 -05:00
parent e06e65bfa6
commit b8a4fdb4c6

View file

@ -3492,10 +3492,23 @@ bool FurnaceGUI::loop() {
} }
break; break;
case GUI_WARN_CLEAR: case GUI_WARN_CLEAR:
if (ImGui::Button("Song (orders and patterns)")) { if (ImGui::Button("All subsongs")) {
stop();
//e->lockEngine([this]() {
//e->curSubSong->clearData();
//});
e->setOrder(0);
curOrder=0;
oldOrder=0;
oldOrder1=0;
MARK_MODIFIED;
ImGui::CloseCurrentPopup();
}
ImGui::SameLine();
if (ImGui::Button("Current subsong")) {
stop(); stop();
e->lockEngine([this]() { e->lockEngine([this]() {
e->song.clearSongData(); e->curSubSong->clearData();
}); });
e->setOrder(0); e->setOrder(0);
curOrder=0; curOrder=0;