diff --git a/src/corelib/ipc/qsharedmemory_posix.cpp b/src/corelib/ipc/qsharedmemory_posix.cpp index 0f53c88964..744a6d67a4 100644 --- a/src/corelib/ipc/qsharedmemory_posix.cpp +++ b/src/corelib/ipc/qsharedmemory_posix.cpp @@ -51,7 +51,8 @@ bool QSharedMemoryPosix::handle(QSharedMemoryPrivate *self) bool QSharedMemoryPosix::cleanHandle(QSharedMemoryPrivate *) { - qt_safe_close(hand); + if (hand != -1) + qt_safe_close(hand); hand = -1; return true;