diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-01-19 12:52:34 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-01-19 12:52:34 (GMT) |
commit | b997254ba37e3ccfaa26be7021e2b172bfd82691 (patch) | |
tree | 87ed9ebcf19974ff52bc9786a51410707cb61f5d /src | |
parent | 5d5461af95d6f7a6b4efd9448e463c361c414dd2 (diff) | |
parent | 26a0d799cd6e987666228afa9cfe017d226c4fdd (diff) | |
download | Qt-b997254ba37e3ccfaa26be7021e2b172bfd82691.zip Qt-b997254ba37e3ccfaa26be7021e2b172bfd82691.tar.gz Qt-b997254ba37e3ccfaa26be7021e2b172bfd82691.tar.bz2 |
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.6-integration
* '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-1:
QNativeSocketEngine windows: Fix performance degredation in write()
Remove QtScript connection when receiver QObject has been deleted
Diffstat (limited to 'src')
-rw-r--r-- | src/network/socket/qnativesocketengine_win.cpp | 13 | ||||
-rw-r--r-- | src/script/bridge/qscriptqobject.cpp | 9 |
2 files changed, 19 insertions, 3 deletions
diff --git a/src/network/socket/qnativesocketengine_win.cpp b/src/network/socket/qnativesocketengine_win.cpp index 81bffd9..8257545 100644 --- a/src/network/socket/qnativesocketengine_win.cpp +++ b/src/network/socket/qnativesocketengine_win.cpp @@ -994,9 +994,9 @@ qint64 QNativeSocketEnginePrivate::nativeWrite(const char *data, qint64 len) { Q_Q(QNativeSocketEngine); qint64 ret = 0; - // don't send more than 49152 per call to WSASendTo to avoid getting a WSAENOBUFS + qint64 bytesToSend = len; + for (;;) { - qint64 bytesToSend = qMin<qint64>(49152, len - ret); WSABUF buf; buf.buf = (char*)data + ret; buf.len = bytesToSend; @@ -1014,6 +1014,12 @@ qint64 QNativeSocketEnginePrivate::nativeWrite(const char *data, qint64 len) continue; } else if (WSAGetLastError() == WSAEWOULDBLOCK) { break; + } else if (WSAGetLastError() == WSAENOBUFS) { + // this function used to not send more than 49152 per call to WSASendTo + // to avoid getting a WSAENOBUFS. However this is a performance regression + // and we think it only appears with old windows versions. We now handle the + // WSAENOBUFS and hope it never appears anyway. + // just go on, the next loop run we will try a smaller number } else { int err = WSAGetLastError(); WS_ERROR_DEBUG(err); @@ -1029,6 +1035,9 @@ qint64 QNativeSocketEnginePrivate::nativeWrite(const char *data, qint64 len) } break; } + + // for next send: + bytesToSend = qMin<qint64>(49152, len - ret); } #if defined (QNATIVESOCKETENGINE_DEBUG) diff --git a/src/script/bridge/qscriptqobject.cpp b/src/script/bridge/qscriptqobject.cpp index 3f4f6bb..db312bc 100644 --- a/src/script/bridge/qscriptqobject.cpp +++ b/src/script/bridge/qscriptqobject.cpp @@ -2220,7 +2220,14 @@ void QObjectConnectionManager::execute(int slotIndex, void **argv) JSC::call(exec, slot, callType, callData, thisObject, jscArgs); if (exec->hadException()) { - engine->emitSignalHandlerException(); + if (slot.inherits(&QtFunction::info) && !static_cast<QtFunction*>(JSC::asObject(slot))->qobject()) { + // The function threw an error because the target QObject has been deleted. + // The connections list is stale; remove the signal handler and ignore the exception. + removeSignalHandler(sender(), signalIndex, receiver, slot); + exec->clearException(); + } else { + engine->emitSignalHandlerException(); + } } } |