diff options
Diffstat (limited to 'src/network/socket/qtcpserver.cpp')
-rw-r--r-- | src/network/socket/qtcpserver.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/network/socket/qtcpserver.cpp b/src/network/socket/qtcpserver.cpp index c1fedc3..1978ee2 100644 --- a/src/network/socket/qtcpserver.cpp +++ b/src/network/socket/qtcpserver.cpp @@ -354,7 +354,12 @@ void QTcpServer::close() if (d->socketEngine) { d->socketEngine->close(); - d->socketEngine->deleteLater(); + QT_TRY { + d->socketEngine->deleteLater(); + } QT_CATCH(const std::bad_alloc &) { + // in out of memory situations, the socketEngine + // will be deleted in ~QTcpServer (it's a child-object of this) + } d->socketEngine = 0; } |