Commit 4ad69790 authored by Arnaud Ruiz's avatar Arnaud Ruiz Committed by Ben Cooksley

Fix for "Too many open files" bug

kdiff3 fails to close files properly leading to stability and speed issues.

Reviewers: mreeves

Reviewed By: mreeves

Differential Revision: https://phabricator.kde.org/D22294
parent 6fd52582
Pipeline #5879 passed with stage
in 8 minutes and 40 seconds
...@@ -741,6 +741,7 @@ bool DirectoryMergeWindow::DirectoryMergeWindowPrivate::fastFileComparison( ...@@ -741,6 +741,7 @@ bool DirectoryMergeWindow::DirectoryMergeWindowPrivate::fastFileComparison(
if(!fi2.open(QIODevice::ReadOnly)) if(!fi2.open(QIODevice::ReadOnly))
{ {
fi1.close();
status = fi2.errorString(); status = fi2.errorString();
return bEqual; return bEqual;
} }
...@@ -758,12 +759,16 @@ bool DirectoryMergeWindow::DirectoryMergeWindowPrivate::fastFileComparison( ...@@ -758,12 +759,16 @@ bool DirectoryMergeWindow::DirectoryMergeWindowPrivate::fastFileComparison(
if(len != fi1.read(&buf1[0], len)) if(len != fi1.read(&buf1[0], len))
{ {
status = fi1.errorString(); status = fi1.errorString();
fi1.close();
fi2.close();
return bEqual; return bEqual;
} }
if(len != fi2.read(&buf2[0], len)) if(len != fi2.read(&buf2[0], len))
{ {
status = fi2.errorString();; status = fi2.errorString();
fi1.close();
fi2.close();
return bEqual; return bEqual;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment