Commit 94d35d22 authored by Dennis Nienhüser's avatar Dennis Nienhüser
Browse files

Fix memory leak: Delete plugin runner and parsing task instance

parent 38c9a28b
......@@ -58,10 +58,14 @@ ParsingRunnerManager::Private::~Private()
// nothing to do
}
void ParsingRunnerManager::Private::cleanupParsingTask( ParsingTask *task )
void ParsingRunnerManager::Private::cleanupParsingTask( ParsingTask *finishedTask )
{
m_parsingTasks.removeAll( task );
mDebug() << "removing task" << m_parsingTasks.size() << " " << (quintptr)task;
for (int i=m_parsingTasks.size()-1; i>=0; --i) {
if (m_parsingTasks[i] == finishedTask) {
m_parsingTasks[i]->deleteLater();
m_parsingTasks.removeAt(i);
}
}
if ( m_parsingTasks.isEmpty() ) {
emit q->parsingFinished();
......
......@@ -96,6 +96,7 @@ void ParsingTask::run()
QString error;
GeoDataDocument* document = m_runner->parseFile( m_fileName, m_role, error );
emit parsed(document, error);
m_runner->deleteLater();
emit finished( this );
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment