summaryrefslogtreecommitdiffstats
path: root/src/gui/image
diff options
context:
space:
mode:
authorSimone Fiorentino <simone.fiorentino@gmail.com>2009-11-20 09:37:37 (GMT)
committerDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-11-20 09:37:37 (GMT)
commit389254874251f91038dff0a0d497a6fd9af09939 (patch)
treeb016f2fe2c2e5b2f9c6c12bd443da11c78f5b8ae /src/gui/image
parent01fec63b7b8f8cae94f92fca1d806fe8c6156299 (diff)
downloadQt-389254874251f91038dff0a0d497a6fd9af09939.zip
Qt-389254874251f91038dff0a0d497a6fd9af09939.tar.gz
Qt-389254874251f91038dff0a0d497a6fd9af09939.tar.bz2
Marking the shmid segment to be destroyed. It prevents leaks when the app crashes
Merge-request: 2080 Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
Diffstat (limited to 'src/gui/image')
-rw-r--r--src/gui/image/qnativeimage.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gui/image/qnativeimage.cpp b/src/gui/image/qnativeimage.cpp
index e4ea2e9..3b43ab6 100644
--- a/src/gui/image/qnativeimage.cpp
+++ b/src/gui/image/qnativeimage.cpp
@@ -178,6 +178,8 @@ QNativeImage::QNativeImage(int width, int height, QImage::Format format,bool /*
if (ok) {
xshmimg->data = (char*)shmat(xshminfo.shmid, 0, 0);
xshminfo.shmaddr = xshmimg->data;
+ if (shmctl(xshminfo.shmid, IPC_RMID, 0) == -1)
+ qWarning() << "Error while marking the shared memory segment to be destroyed";
ok = (xshminfo.shmaddr != (char*)-1);
if (ok)
image = QImage((uchar *)xshmimg->data, width, height, systemFormat());