From 86110d70383a7eb44689226ad8a7b5276bd1e9c4 Mon Sep 17 00:00:00 2001 From: Daniel Teske Date: Thu, 23 May 2013 12:27:28 +0200 Subject: [PATCH] Android: Clen libs on device: Fix memory leak One QProcess per run of clean libs Change-Id: Idcf6155e71ca5cec7cb4be1509191ba49c69cefd Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/plugins/android/androiddeploystep.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plugins/android/androiddeploystep.cpp b/src/plugins/android/androiddeploystep.cpp index 000246b1833..222da0e35c3 100644 --- a/src/plugins/android/androiddeploystep.cpp +++ b/src/plugins/android/androiddeploystep.cpp @@ -190,16 +190,18 @@ void AndroidDeployStep::cleanLibsOnDevice() + arguments.join(QLatin1String(" ")), Core::MessageManager::NoModeSwitch); process->start(adb, arguments); + if (!process->waitForStarted(500)) + delete process; } void AndroidDeployStep::cleanLibsFinished() { QProcess *process = qobject_cast(sender()); - if (!process) - return; + QTC_ASSERT(process, return); Core::MessageManager::instance()->printToOutputPane(QString::fromLocal8Bit(process->readAll()), Core::MessageManager::NoModeSwitch); Core::MessageManager::instance()->printToOutputPane(tr("adb finished with exit code %1.").arg(process->exitCode()), Core::MessageManager::NoModeSwitch); + process->deleteLater(); } void AndroidDeployStep::setDeployAction(AndroidDeployStep::AndroidDeployAction deploy)