summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/thread')
-rw-r--r--src/corelib/thread/qfuturewatcher.cpp8
-rw-r--r--src/corelib/thread/qthread.cpp1
-rw-r--r--src/corelib/thread/qthread_win.cpp2
3 files changed, 7 insertions, 4 deletions
diff --git a/src/corelib/thread/qfuturewatcher.cpp b/src/corelib/thread/qfuturewatcher.cpp
index 5b68af1fbc..faeb6b3a28 100644
--- a/src/corelib/thread/qfuturewatcher.cpp
+++ b/src/corelib/thread/qfuturewatcher.cpp
@@ -98,7 +98,9 @@ QT_BEGIN_NAMESPACE
/*! \fn template <typename T> QFutureWatcher<T>::QFutureWatcher(QObject *parent)
- Constructs a new QFutureWatcher with the given \a parent.
+ Constructs a new QFutureWatcher with the given \a parent. Until a future is
+ set with setFuture(), the functions isStarted(), isCanceled(), and
+ isFinished() return \c true.
*/
QFutureWatcherBase::QFutureWatcherBase(QObject *parent)
:QObject(*new QFutureWatcherBasePrivate, parent)
@@ -241,7 +243,7 @@ QString QFutureWatcherBase::progressText() const
/*! \fn template <typename T> bool QFutureWatcher<T>::isStarted() const
Returns \c true if the asynchronous computation represented by the future()
- has been started; otherwise returns \c false.
+ has been started, or if no future has been set; otherwise returns \c false.
*/
bool QFutureWatcherBase::isStarted() const
{
@@ -272,7 +274,7 @@ bool QFutureWatcherBase::isRunning() const
/*! \fn template <typename T> bool QFutureWatcher<T>::isCanceled() const
Returns \c true if the asynchronous computation has been canceled with the
- cancel() function; otherwise returns \c false.
+ cancel() function, or if no future has been set; otherwise returns \c false.
Be aware that the computation may still be running even though this
function returns \c true. See cancel() for more details.
diff --git a/src/corelib/thread/qthread.cpp b/src/corelib/thread/qthread.cpp
index 5df0508829..d2d6435004 100644
--- a/src/corelib/thread/qthread.cpp
+++ b/src/corelib/thread/qthread.cpp
@@ -879,6 +879,7 @@ QThreadPrivate::QThreadPrivate(QThreadData *d) : data(d ? d : new QThreadData)
QThreadPrivate::~QThreadPrivate()
{
+ data->thread = nullptr; // prevent QThreadData from deleting the QThreadPrivate (again).
delete data;
}
diff --git a/src/corelib/thread/qthread_win.cpp b/src/corelib/thread/qthread_win.cpp
index caf51722cd..eebaf90d9b 100644
--- a/src/corelib/thread/qthread_win.cpp
+++ b/src/corelib/thread/qthread_win.cpp
@@ -511,7 +511,7 @@ void QThread::start(Priority priority)
#endif // Q_OS_WINRT
if (!d->handle) {
- qErrnoWarning(errno, "QThread::start: Failed to create thread");
+ qErrnoWarning("QThread::start: Failed to create thread");
d->running = false;
d->finished = true;
return;