From kde-commits Thu Jan 06 21:43:51 2011 From: Marco Martin Date: Thu, 06 Jan 2011 21:43:51 +0000 To: kde-commits Subject: KDE/kdelibs/plasma/private Message-Id: <20110106214351.97F97AC8B0 () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=129435028717083 SVN commit 1212407 by mart: 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 M +3 -4 storage.cpp --- trunk/KDE/kdelibs/plasma/private/storage.cpp #1212406:1212407 @@ -85,7 +85,6 @@ query.bindValue(":datavalue", params["data"]); const bool success = query.exec(); setResult(success); - return; } else if (operationName() == "retrieve") { QSqlQuery query(m_db); @@ -124,9 +123,6 @@ } setResult(h); - return; - } else { - return; } } else if (operationName() == "delete") { @@ -165,6 +161,9 @@ } else { 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 ¶meters)