summaryrefslogtreecommitdiffstats
path: root/src/network/socket/qtcpserver.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/socket/qtcpserver.cpp')
-rw-r--r--src/network/socket/qtcpserver.cpp7
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;
}