diff data/fileio/FileSource.cpp @ 470:dddd4ab77068

* revert changes from r1254 as well; also restore a fix from r1245 that had been reverted in the previous commit
author Chris Cannam
date Tue, 28 Oct 2008 11:37:33 +0000
parents a8a7b8f698c8
children 05383ee78f3e
line wrap: on
line diff
--- a/data/fileio/FileSource.cpp	Tue Oct 28 11:07:08 2008 +0000
+++ b/data/fileio/FileSource.cpp	Tue Oct 28 11:37:33 2008 +0000
@@ -59,12 +59,6 @@
     m_reporter(reporter),
     m_refCounted(false)
 {
-
-    if (cacheMode == PersistentCache) {
-        std::cerr << "FileSource::FileSource: Persistent cache mode used for \"" << fileOrUrl.toStdString() << "\"" << std::endl;
-        exit(1);
-    }
-
 #ifdef DEBUG_FILE_SOURCE
     std::cerr << "FileSource::FileSource(" << fileOrUrl.toStdString() << ")" << std::endl;
 #endif
@@ -129,12 +123,6 @@
     m_reporter(reporter),
     m_refCounted(false)
 {
-
-    if (cacheMode == PersistentCache) {
-        std::cerr << "FileSource::FileSource: Persistent cache mode used for \"" << url.toString().toStdString() << "\"" << std::endl;
-        exit(1);
-    }
-
 #ifdef DEBUG_FILE_SOURCE
     std::cerr << "FileSource::FileSource(" << url.toString().toStdString() << ") [as url]" << std::endl;
 #endif
@@ -417,6 +405,10 @@
 void
 FileSource::cleanup()
 {
+    if (m_done) {
+        delete m_localFile; // does not actually delete the file
+        m_localFile = 0;
+    }
     m_done = true;
     if (m_http) {
         QHttp *h = m_http;
@@ -430,8 +422,10 @@
         f->abort();
         f->deleteLater();
     }
-    delete m_localFile; // does not actually delete the file
-    m_localFile = 0;
+    if (m_localFile) {
+        delete m_localFile; // does not actually delete the file
+        m_localFile = 0;
+    }
 }
 
 bool