diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-03-25 15:27:39 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-03-26 20:03:32 +0000 |
commit | 742a07ece1c99db964617015c06a05b4cb0dd995 (patch) | |
tree | f34d3a8e6b53660689b78bd7f33fa2cf9de7c2b1 /src/corelib/io/qwindowspipereader.cpp | |
parent | e79b1dcdf542be3a20d5c21ea163ff857ed875bf (diff) |
Use QScopedValueRollback more as a reentrancy guard
It is documented for the use, but we were rarely using it.
Change-Id: I812b9e6c8fbf204aba43ce2b79eca308ca75de88
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/io/qwindowspipereader.cpp')
-rw-r--r-- | src/corelib/io/qwindowspipereader.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/io/qwindowspipereader.cpp b/src/corelib/io/qwindowspipereader.cpp index 15c9f52cf3..1f03ac5d5a 100644 --- a/src/corelib/io/qwindowspipereader.cpp +++ b/src/corelib/io/qwindowspipereader.cpp @@ -40,6 +40,7 @@ #include "qwindowspipereader_p.h" #include "qiodevice_p.h" #include <qelapsedtimer.h> +#include <qscopedvaluerollback.h> QT_BEGIN_NAMESPACE @@ -301,9 +302,8 @@ void QWindowsPipeReader::emitPendingReadyRead() { if (readyReadPending) { readyReadPending = false; - inReadyRead = true; + QScopedValueRollback<bool> guard(inReadyRead, true); emit readyRead(); - inReadyRead = false; } } |