summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkh1 <karsten.heimrich@digia.com>2013-06-04 17:28:24 +0200
committerKarsten Heimrich <karsten.heimrich@digia.com>2013-06-05 11:14:22 +0200
commit682eff70d6155a391de1860b520259ff6c581d74 (patch)
treedc625d4193efc90d025127f99bbc2b3c788a0639
parentdfbb731676e59b42f548dfca15e60f08cfcdc2f5 (diff)
Make sure we close the file once we read the content.
Fixes exception thrown on windows in case we can't read the content or got an repository update. This can happen since the finish signal is emitted synchronously and the following code is trying to delete the still opened updates xml file. Change-Id: I32b252e372ed11c05b04e0d2736400527bdb9a59 Reviewed-by: Niels Weber <niels.weber@digia.com>
-rw-r--r--src/libs/installer/getrepositorymetainfojob.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libs/installer/getrepositorymetainfojob.cpp b/src/libs/installer/getrepositorymetainfojob.cpp
index 14299fbb4..f711431b9 100644
--- a/src/libs/installer/getrepositorymetainfojob.cpp
+++ b/src/libs/installer/getrepositorymetainfojob.cpp
@@ -267,7 +267,10 @@ void GetRepositoryMetaInfoJob::updatesXmlDownloadFinished()
QString err;
QDomDocument doc;
- if (!doc.setContent(&updatesFile, &err)) {
+ const bool success = doc.setContent(&updatesFile, &err);
+ updatesFile.close();
+
+ if (!success) {
const QString msg = tr("Could not fetch a valid version of Updates.xml from repository: %1. "
"Error: %2").arg(m_repository.url().toString(), err);