diff --git a/src/app/crash/data_recovery.cpp b/src/app/crash/data_recovery.cpp index c9a3138c4..ff1751286 100644 --- a/src/app/crash/data_recovery.cpp +++ b/src/app/crash/data_recovery.cpp @@ -16,6 +16,8 @@ #include "base/fs.h" #include "base/time.h" +#include + namespace app { namespace crash { @@ -50,6 +52,12 @@ DataRecovery::DataRecovery(doc::Context* ctx) } } + // Sort sessions from the most recent one to the oldest one + std::sort(m_sessions.begin(), m_sessions.end(), + [](const SessionPtr& a, const SessionPtr& b) { + return a->name() > b->name(); + }); + // Create a new session base::pid pid = base::get_current_process_id(); std::string newSessionDir;