From 448a8603bb0609bf880a2c1b92b26c2005e1cf63 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Fri, 13 Aug 2010 13:25:46 +0300 Subject: Fix check to remove unnecessary deployments in Symbian Previously check to remove files from deployment in case the deployment target location was the same as the source location was done using QFileInfo equality, which resolved to true when file didn't yet exist at the time qmake was run. Changed the check to compare absolute paths instead. Task-number: QTBUG-12879 Reviewed-by: Shane Kearns --- qmake/generators/symbian/initprojectdeploy_symbian.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/qmake/generators/symbian/initprojectdeploy_symbian.cpp b/qmake/generators/symbian/initprojectdeploy_symbian.cpp index 382e012..776a646 100644 --- a/qmake/generators/symbian/initprojectdeploy_symbian.cpp +++ b/qmake/generators/symbian/initprojectdeploy_symbian.cpp @@ -353,7 +353,11 @@ void initProjectDeploySymbian(QMakeProject* project, CopyItem &item = i.next(); QFileInfo fromItem(item.from); QFileInfo toItem(item.to); - if (fromItem == toItem) +#if defined(Q_OS_WIN) + if (0 == fromItem.absoluteFilePath().compare(toItem.absoluteFilePath(), Qt::CaseInsensitive)) +#else + if (0 == fromItem.absoluteFilePath().compare(toItem.absoluteFilePath())) +#endif i.remove(); } } -- cgit v0.12 From 5d32b723332acab5fdf880aa0d555ab8e05d79dd Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Fri, 13 Aug 2010 12:59:55 +0100 Subject: Fix for memory leak in qt_init Reviewed-by: Miikka Heikkinen --- src/gui/kernel/qapplication_s60.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index e64ebb1..559bb6a 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -1475,6 +1475,8 @@ void qt_init(QApplicationPrivate * /* priv */, int) S60->avkonComponentsSupportTransparency = (value==1) ? true : false; } } + delete repository; + repository = 0; #endif #ifdef QT_KEYPAD_NAVIGATION -- cgit v0.12 From 434ce6748ea7f082357b6d7ab542c9fa2285bd4c Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Fri, 13 Aug 2010 15:22:25 +0300 Subject: Fix "installer_sis" and "deploy" targets when TARGET has path Dependencies got generated wrong in Makefile because sis is always created in the .pro file directory but dependency included path that was in TARGET. Task-number: QTBUG-12884 Reviewed-by: Shane Kearns --- mkspecs/features/sis_targets.prf | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mkspecs/features/sis_targets.prf b/mkspecs/features/sis_targets.prf index 99f5910..abdf2d4 100644 --- a/mkspecs/features/sis_targets.prf +++ b/mkspecs/features/sis_targets.prf @@ -11,7 +11,6 @@ else:!equals(DEPLOYMENT, default_deployment) { equals(GENERATE_SIS_TARGETS, true) { symbian-abld|symbian-sbsv2 { - sis_destdir = make_cache_name = .make.cache sis_target.target = sis sis_target.commands = $(if $(wildcard $$basename(TARGET)_template.pkg), \ @@ -50,7 +49,7 @@ equals(GENERATE_SIS_TARGETS, true) { ok_unsigned_sis_target.target = ok_unsigned_sis ok_unsigned_sis_target.commands = createpackage.bat $(QT_SIS_OPTIONS) -o $$basename(TARGET)_template.pkg $(QT_SIS_TARGET) - target_sis_target.target = $${sis_destdir}$${TARGET}.sis + target_sis_target.target = $$basename(TARGET).sis target_sis_target.commands = $(MAKE) -f $(MAKEFILE) sis installer_sis_target.target = installer_sis @@ -59,7 +58,7 @@ equals(GENERATE_SIS_TARGETS, true) { , \ $(MAKE) -f $(MAKEFILE) fail_sis_nopkg \ ) - installer_sis_target.depends = $${sis_destdir}$${TARGET}.sis + installer_sis_target.depends = $$basename(TARGET).sis ok_installer_sis_target.target = ok_installer_sis ok_installer_sis_target.commands = createpackage.bat $(QT_SIS_OPTIONS) $$basename(TARGET)_installer.pkg - \ -- cgit v0.12 From 7cfc9f2245162944f3d9a29ad73cd93e2bcf197f Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Mon, 16 Aug 2010 16:09:34 +0300 Subject: Fix QProcessManager destruction If QProcessManager destructor is ran as part of global static cleanup, manager thread will most likely be terminated by kernel at that point, so trying to delete QProcessActives and QProcessMediators will panic as they will still be active. They can also no longer be properly canceled as the thread is already gone. In case manager thread has already died, which implies that process exit is imminent, we simply do nothing and let the deletion of the main heap at process exit take care of stray objects. Task-number: QTBUG-11218 Reviewed-by: Janne Koskinen --- src/corelib/io/qprocess_symbian.cpp | 47 ++++++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 19 deletions(-) diff --git a/src/corelib/io/qprocess_symbian.cpp b/src/corelib/io/qprocess_symbian.cpp index af657b2..003e781 100644 --- a/src/corelib/io/qprocess_symbian.cpp +++ b/src/corelib/io/qprocess_symbian.cpp @@ -375,10 +375,9 @@ QProcessActive::QProcessActive() // Nothing to do } -// Called from ProcessManagerThread +// Called from main thread QProcessActive::~QProcessActive() { - Cancel(); process = NULL; pproc = NULL; } @@ -482,10 +481,9 @@ QProcessManagerMediator::QProcessManagerMediator() // Nothing to do } -// Called from ProcessManagerThread +// Called from main thread QProcessManagerMediator::~QProcessManagerMediator() { - Cancel(); processManagerThread.Close(); currentCommand = ENoCommand; currentObserver = NULL; @@ -648,25 +646,36 @@ QProcessManager::QProcessManager() QProcessManager::~QProcessManager() { QPROCESS_DEBUG_PRINT("QProcessManager::~QProcessManager()"); - // Cancel death listening for all child processes - if (mediator) { - QMap::Iterator it = children.begin(); - while (it != children.end()) { - // Remove all monitors - QProcessActive *active = it.value(); - mediator->remove(active); - - QPROCESS_DEBUG_PRINT("QProcessManager::~QProcessManager() removed listening for a process"); - ++it; + + // Check if manager thread is still alive. If this destructor is ran as part of global + // static cleanup, manager thread will most likely be terminated by kernel at this point, + // so trying to delete QProcessActives and QProcessMediators will panic as they + // will still be active. They can also no longer be canceled as the thread is already gone. + // In case manager thread has already died, we simply do nothing and let the deletion of + // the main heap at process exit take care of stray objects. + + if (managerThread.Handle() && managerThread.ExitType() == EExitPending) { + // Cancel death listening for all child processes + if (mediator) { + QMap::Iterator it = children.begin(); + while (it != children.end()) { + // Remove all monitors + QProcessActive *active = it.value(); + mediator->remove(active); + + QPROCESS_DEBUG_PRINT("QProcessManager::~QProcessManager() removed listening for a process"); + ++it; + } + + // Terminate process manager thread. + mediator->terminate(); + delete mediator; } - // Terminate process manager thread. - mediator->terminate(); - delete mediator; + qDeleteAll(children.values()); + children.clear(); } - qDeleteAll(children.values()); - children.clear(); managerThread.Close(); managerMutex.Close(); } -- cgit v0.12