diff --git a/Trenser.VehicleServiceSystem/Trenser.VehicleServiceSystem/datastores/DataStore.h b/Trenser.VehicleServiceSystem/Trenser.VehicleServiceSystem/datastores/DataStore.h index 021d831..03eb0eb 100644 --- a/Trenser.VehicleServiceSystem/Trenser.VehicleServiceSystem/datastores/DataStore.h +++ b/Trenser.VehicleServiceSystem/Trenser.VehicleServiceSystem/datastores/DataStore.h @@ -220,6 +220,12 @@ void DataStore::refreshCache(util::Map>& cac if (oldIndex != -1) { TrackedRecord& oldRecord = oldCache.getValueAt(oldIndex); + if (oldRecord.state == RecordState::MODIFIED) + { + delete refreshedRecord.data; + cache.insert(id, oldRecord); + continue; + } *oldRecord.data = *refreshedRecord.data; oldRecord.slotIndex = refreshedRecord.slotIndex; oldRecord.state = refreshedRecord.state;