diff --git a/gui/resultsview.cpp b/gui/resultsview.cpp index 2c47ac177..eae5661da 100644 --- a/gui/resultsview.cpp +++ b/gui/resultsview.cpp @@ -331,20 +331,15 @@ void ResultsView::readErrorsXml(const QString &filename) return; } - XmlReport *report = new XmlReportV2(filename); - + XmlReportV2 report(filename); QList errors; - if (report) { - if (report->open()) - errors = report->read(); - else { - QMessageBox msgBox; - msgBox.setText(tr("Failed to read the report.")); - msgBox.setIcon(QMessageBox::Critical); - msgBox.exec(); - } - delete report; - report = NULL; + if (report.open()) { + errors = report.read(); + } else { + QMessageBox msgBox; + msgBox.setText(tr("Failed to read the report.")); + msgBox.setIcon(QMessageBox::Critical); + msgBox.exec(); } ErrorItem item;