summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkarsh Simha <akarsh@kde.org>2016-10-02 12:28:15 (GMT)
committerAkarsh Simha <akarsh@kde.org>2016-10-02 12:35:58 (GMT)
commit55a83c05d27c22c68a84b2e217da26c0b50c2b29 (patch)
tree8f5a58cc8537b65e8df7c04f5c5225947498e5c5
parentf5a4b8cce5fe6d2aaead5da6a6f2abbb7c4123c3 (diff)
Fix crashes in KSDssDownloader
Must use deleteLater() as there may still be events to process This seems to fix the crash (at least I cannot reproduce it as easily any more)
-rw-r--r--kstars/auxiliary/ksdssdownloader.cpp6
-rw-r--r--kstars/tools/nameresolver.cpp1
2 files changed, 4 insertions, 3 deletions
diff --git a/kstars/auxiliary/ksdssdownloader.cpp b/kstars/auxiliary/ksdssdownloader.cpp
index 2512036..c5f9301 100644
--- a/kstars/auxiliary/ksdssdownloader.cpp
+++ b/kstars/auxiliary/ksdssdownloader.cpp
@@ -232,7 +232,7 @@ void KSDssDownloader::singleDownloadFinished()
m_TempFile.open();
m_TempFile.write(downloadJob->downloadedData());
m_TempFile.close();
- delete (downloadJob);
+ downloadJob->deleteLater();
// Check if we have a proper DSS image or the DSS server failed
QMimeDatabase mdb;
@@ -256,7 +256,7 @@ void KSDssDownloader::downloadAttemptFinished()
// FIXME: do SDSS-y things
emit downloadComplete( false );
deleteLater();
- delete (downloadJob);
+ downloadJob->deleteLater();
return;
}
else
@@ -264,7 +264,7 @@ void KSDssDownloader::downloadAttemptFinished()
m_TempFile.open();
m_TempFile.write(downloadJob->downloadedData());
m_TempFile.close();
- delete (downloadJob);
+ downloadJob->deleteLater();
// Check if we have a proper DSS image or the DSS server failed
QMimeDatabase mdb;
diff --git a/kstars/tools/nameresolver.cpp b/kstars/tools/nameresolver.cpp
index 1cccb8a..c8ada23 100644
--- a/kstars/tools/nameresolver.cpp
+++ b/kstars/tools/nameresolver.cpp
@@ -86,6 +86,7 @@ bool NameResolver::NameResolverInternals::sesameResolver( class CatalogEntryData
}
QXmlStreamReader xml( response->readAll() );
+ response->deleteLater();
if( xml.atEnd() ) {
// file is empty
msg = xi18n("Empty result instead of expected XML from CDS Sesame! Maybe bad internet connection?");