Skip to content

Commit 283c9e7

Browse files
committed
Fix issue #2746: Windows7 Winmerge v2.16.46.0 crash prone (#1 WinMerge crashes after successfully deleting files.)
1 parent 1ae4884 commit 283c9e7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Src/FileActionScript.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,19 @@ void FileActionScript::RemoveDuplicates()
6060
return std::tie(a.src, a.dest, a.atype) < std::tie(b.src, b.dest, b.atype);
6161
};
6262

63+
auto compare_by_context = [](const FileActionItem& a, const FileActionItem& b) {
64+
return a.context < b.context;
65+
};
66+
6367
auto equal = [](const FileActionItem& a, const FileActionItem& b) {
6468
return std::tie(a.src, a.dest, a.atype) == std::tie(b.src, b.dest, b.atype);
6569
};
6670

6771
std::sort(m_actions.begin(), m_actions.end(), compare);
6872

6973
m_actions.erase(std::unique(m_actions.begin(), m_actions.end(), equal), m_actions.end());
74+
75+
std::sort(m_actions.begin(), m_actions.end(), compare_by_context);
7076
}
7177

7278
/**

0 commit comments

Comments
 (0)