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; return;
} }
for (auto & day : daylist) {
delete day;
}
daylist.clear();
for (auto & mach : m_machlist) { for (auto & mach : m_machlist) {
mach->saveSessionInfo(); mach->saveSessionInfo();
mach->sessionlist.clear(); mach->sessionlist.clear();
mach->day.clear(); mach->day.clear();
} }
for (auto & day : daylist) {
delete day;
}
daylist.clear();
removeLock(); removeLock();
} }
void Profile::LoadMachineData(ProgressDialog *progress) void Profile::LoadMachineData(ProgressDialog *progress)