close the strage db when the job is over.
there were dangling file pointers before that could crash plasma when they go beyond the maximum allowed limit BUG:259833 CCBUG:247798 BUG:235051 svn path=/trunk/KDE/kdelibs/; revision=1212407
This commit is contained in:
parent
54ad0622e7
commit
6d042ac25a
@ -85,7 +85,6 @@ void StorageJob::start()
|
|||||||
query.bindValue(":datavalue", params["data"]);
|
query.bindValue(":datavalue", params["data"]);
|
||||||
const bool success = query.exec();
|
const bool success = query.exec();
|
||||||
setResult(success);
|
setResult(success);
|
||||||
return;
|
|
||||||
|
|
||||||
} else if (operationName() == "retrieve") {
|
} else if (operationName() == "retrieve") {
|
||||||
QSqlQuery query(m_db);
|
QSqlQuery query(m_db);
|
||||||
@ -124,9 +123,6 @@ void StorageJob::start()
|
|||||||
}
|
}
|
||||||
|
|
||||||
setResult(h);
|
setResult(h);
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (operationName() == "delete") {
|
} else if (operationName() == "delete") {
|
||||||
@ -165,6 +161,9 @@ void StorageJob::start()
|
|||||||
} else {
|
} else {
|
||||||
setError(true);
|
setError(true);
|
||||||
}
|
}
|
||||||
|
//TODO: use a single shared db per thread
|
||||||
|
m_db.close();
|
||||||
|
QSqlDatabase::removeDatabase(m_db.connectionName());
|
||||||
}
|
}
|
||||||
|
|
||||||
Plasma::ServiceJob* Storage::createJob(const QString &operation, QMap<QString, QVariant> ¶meters)
|
Plasma::ServiceJob* Storage::createJob(const QString &operation, QMap<QString, QVariant> ¶meters)
|
||||||
|
Loading…
Reference in New Issue
Block a user