Fix use-after-free in Profile::UnloadMachineData

This commit is contained in:
Norman Heino 2019-05-26 17:18:42 +02:00
parent f05cc5fbc5
commit 6b7fe4c8f2

View File

@ -581,16 +581,17 @@ void Profile::UnloadMachineData()
return;
}
for (auto & day : daylist) {
delete day;
}
daylist.clear();
for (auto & mach : m_machlist) {
mach->saveSessionInfo();
mach->sessionlist.clear();
mach->day.clear();
}
for (auto & day : daylist) {
delete day;
}
daylist.clear();
removeLock();
}
void Profile::LoadMachineData(ProgressDialog *progress)