summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-02-16 22:06:42 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-02-16 22:06:42 (GMT)
commitec3dc06b5fbf7ef37e0836992f6d7a3fd49c5891 (patch)
tree195c66ded290b2ebb4b2398c8967666eb0e7c2aa /src/network
parent95d3bd3fc993d7c8c1fe92960c617a3392d87f66 (diff)
parent9e5e97f3b5eaa9cda471be44a5c59b51561393b6 (diff)
downloadQt-ec3dc06b5fbf7ef37e0836992f6d7a3fd49c5891.zip
Qt-ec3dc06b5fbf7ef37e0836992f6d7a3fd49c5891.tar.gz
Qt-ec3dc06b5fbf7ef37e0836992f6d7a3fd49c5891.tar.bz2
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.6-integration
* '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2: (26 commits) QLocalSocket::isValid on Windows must check for broken connection fix pipe handle leak in qlocalsocket_win.cpp GraphicsViewBenchmark: Run app in full screen mode on small desktops. Fix Thai text on Windows 7 Fix License headers. QTextCodec::codecForName. Insert in the cache in all cases. Prevented calling the pixmap filter implementations with null pixmaps. Make it possible to run benchmarks with the "-graphicssystem" switch. Add support for running the GraphicsViewBenchmark application manually. Bump version to 4.6.3. Fixed a GLX warning that occured with some Intel chipsets under X11. Fixed compile for maemo6. Cleanup QEglContext & EGLDisplays Moved 'hasAlpha' property from GL2 engine to GL paint device. Remove useless qDebug in QTextCodec autotest QTextCodec: Symbian has codec for UCS2, only fallback to UTF16 if UCS2 codec cannot be loaded Add caching to QTextCodec::codecForName and QTextCodec::codecForMib Add benchmark for QTextCodec Fix several bugs with GL texture cache Compile fix for OpenGL ES. ...
Diffstat (limited to 'src/network')
-rw-r--r--src/network/socket/qlocalsocket_p.h6
-rw-r--r--src/network/socket/qlocalsocket_win.cpp22
2 files changed, 21 insertions, 7 deletions
diff --git a/src/network/socket/qlocalsocket_p.h b/src/network/socket/qlocalsocket_p.h
index 081697b..0f1c23c 100644
--- a/src/network/socket/qlocalsocket_p.h
+++ b/src/network/socket/qlocalsocket_p.h
@@ -128,10 +128,8 @@ public:
void _q_stateChanged(QAbstractSocket::SocketState newState);
void _q_error(QAbstractSocket::SocketError newError);
#elif defined(Q_OS_WIN)
- ~QLocalSocketPrivate() {
- CloseHandle(overlapped.hEvent);
- }
-
+ ~QLocalSocketPrivate();
+ void destroyPipeHandles();
void setErrorString(const QString &function);
void _q_notified();
void _q_canWrite();
diff --git a/src/network/socket/qlocalsocket_win.cpp b/src/network/socket/qlocalsocket_win.cpp
index 1f94df6..3283bf2 100644
--- a/src/network/socket/qlocalsocket_win.cpp
+++ b/src/network/socket/qlocalsocket_win.cpp
@@ -110,6 +110,20 @@ QLocalSocketPrivate::QLocalSocketPrivate() : QIODevicePrivate(),
{
}
+QLocalSocketPrivate::~QLocalSocketPrivate()
+{
+ destroyPipeHandles();
+ CloseHandle(overlapped.hEvent);
+}
+
+void QLocalSocketPrivate::destroyPipeHandles()
+{
+ if (handle != INVALID_HANDLE_VALUE) {
+ DisconnectNamedPipe(handle);
+ CloseHandle(handle);
+ }
+}
+
void QLocalSocket::connectToServer(const QString &name, OpenMode openMode)
{
Q_D(QLocalSocket);
@@ -388,8 +402,7 @@ void QLocalSocket::close()
d->readSequenceStarted = false;
d->pendingReadyRead = false;
d->pipeClosed = false;
- DisconnectNamedPipe(d->handle);
- CloseHandle(d->handle);
+ d->destroyPipeHandles();
d->handle = INVALID_HANDLE_VALUE;
ResetEvent(d->overlapped.hEvent);
d->state = UnconnectedState;
@@ -524,7 +537,10 @@ bool QLocalSocket::waitForDisconnected(int msecs)
bool QLocalSocket::isValid() const
{
Q_D(const QLocalSocket);
- return (d->handle != INVALID_HANDLE_VALUE);
+ if (d->handle == INVALID_HANDLE_VALUE)
+ return false;
+
+ return PeekNamedPipe(d->handle, NULL, 0, NULL, NULL, NULL);
}
bool QLocalSocket::waitForReadyRead(int msecs)