Commit 3360a7b5 authored by Slava Monich's avatar Slava Monich

Merge pull request #26 from monich/leaks

Fix memory leaks
parents d07f52cc 747605d4
......@@ -405,7 +405,7 @@ int DbManager::createCallbackEntry(int key,
This method returns a key of the created transfer or -1 on failure.
*/
int DbManager::createTransferEntry(MediaItem *mediaItem)
int DbManager::createTransferEntry(const MediaItem *mediaItem)
{
Q_D(DbManager);
QSqlQuery query;
......
......@@ -51,7 +51,7 @@ public:
const QString &cancelMethod,
const QString &restartMethod);
int createTransferEntry(MediaItem *mediaItem);
int createTransferEntry(const MediaItem *mediaItem);
bool updateTransferStatus(int key, TransferEngineData::TransferStatus status);
......
......@@ -236,10 +236,8 @@ void TransferEnginePrivate::enabledPluginsCheck()
if (info->ready()) {
if (info->info().count() > 0) {
m_enabledPlugins << info->info();
} else {
// Plugin has nothing to provide, just ignore it
delete info;
}
delete info;
} else {
// These object will be cleaned in pluginInfoReady() slot.
m_infoObjects << info;
......@@ -1020,6 +1018,8 @@ int TransferEngine::createSync(const QString &displayName,
mediaItem->setValue(MediaItem::RestartSupported,!restartMethod.isEmpty());
const int key = DbManager::instance()->createTransferEntry(mediaItem);
delete mediaItem;
Q_D(TransferEngine);
d->m_activityMonitor->newActivity(key);
d->m_keyTypeCache.insert(key, TransferEngineData::Sync);
......
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