From ac8d45fa4218228dadb5a402a8cd88edf7617f52 Mon Sep 17 00:00:00 2001 From: Frank Date: Wed, 13 Dec 2017 11:59:09 -0800 Subject: protect access to ResumptionDataJson during state save --- .../application_manager/src/resumption/resumption_data_json.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/application_manager/src/resumption/resumption_data_json.cc b/src/components/application_manager/src/resumption/resumption_data_json.cc index 7866fc4de1..2b7ac31b56 100644 --- a/src/components/application_manager/src/resumption/resumption_data_json.cc +++ b/src/components/application_manager/src/resumption/resumption_data_json.cc @@ -480,6 +480,9 @@ bool ResumptionDataJson::DropAppDataResumption(const std::string& device_id, } void ResumptionDataJson::Persist() { + // We lock the resumption data because SaveStateToFileSystem accesses + // the same dictionary that we use here in ResumptionDataJson + sync_primitives::AutoLock autolock(resumption_lock_); last_state().SaveStateToFileSystem(); } -- cgit v1.2.1