# HG changeset patch # User Chris Cannam # Date 1225193853 0 # Node ID dddd4ab7706832ac9cdfadb8ccf8eabb92a751b9 # Parent a8a7b8f698c831a504edf2bd07c11de528ffe23b * revert changes from r1254 as well; also restore a fix from r1245 that had been reverted in the previous commit diff -r a8a7b8f698c8 -r dddd4ab77068 data/fileio/FileSource.cpp --- 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