summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qwindowsurface_qws.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/painting/qwindowsurface_qws.cpp')
-rw-r--r--src/gui/painting/qwindowsurface_qws.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/gui/painting/qwindowsurface_qws.cpp b/src/gui/painting/qwindowsurface_qws.cpp
index 7e8cf9b..3789a33 100644
--- a/src/gui/painting/qwindowsurface_qws.cpp
+++ b/src/gui/painting/qwindowsurface_qws.cpp
@@ -1065,10 +1065,12 @@ bool QWSSharedMemSurface::setMemory(int memId)
return true;
mem.detach();
- if (!mem.attach(memId)) {
+
+ if (memId != -1 && !mem.attach(memId)) {
+#ifndef QT_NO_DEBUG
perror("QWSSharedMemSurface: attaching to shared memory");
- qCritical("QWSSharedMemSurface: Error attaching to"
- " shared memory 0x%x", memId);
+ qCritical("QWSSharedMemSurface: Error attaching to shared memory 0x%x", memId);
+#endif
return false;
}