forked from qt-creator/qt-creator
PythonSettings: Don't leak running watchers
Detected by memory analyzer. When shutdown comes while pythonsFromRegistry() or pythonsFromPath() is still running, the corresponding QFutureWatcher is leaked. Employ TaskTreeRunner instead. It handles the cancellation of the running tasks automatically on its destruction. Make pythonsFromRegistry() and pythonsFromPath() cancelable, by providing QPromise as a parameter and check for canceled state on every iteration. Change-Id: Iae7c7d1ed764646b8203bd7ca8b9580cb999b80c Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -5,6 +5,8 @@
|
||||
|
||||
#include <projectexplorer/runconfigurationaspects.h>
|
||||
|
||||
#include <solutions/tasking/tasktreerunner.h>
|
||||
|
||||
#include <utils/filepath.h>
|
||||
|
||||
namespace Python::Internal {
|
||||
@@ -69,6 +71,7 @@ private:
|
||||
QString m_defaultInterpreterId;
|
||||
bool m_pylsEnabled = true;
|
||||
QString m_pylsConfiguration;
|
||||
Tasking::TaskTreeRunner m_taskTreeRunner;
|
||||
|
||||
static void saveSettings();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user