diff options
author | Miroslav Safr <miroslav.safr@tieto.com> | 2011-01-12 11:18:47 +0200 |
---|---|---|
committer | Kimmo Hämäläinen <kimmo.hamalainen@nokia.com> | 2011-01-12 12:39:03 +0200 |
commit | dec0cdb8d65103cd3682e90ec8f710c422681835 (patch) | |
tree | deee31efceb8559f3d5d12784a8b2136cd7ee44c /src/mtexturepixmapitem_glx.cpp | |
parent | ba0c060bb0a27f8fb802eddadd658528a8fb0766 (diff) |
Merge the following commit except for the src/mtexturepixmapitem_p.cpp parts.
Fixes: BMC#11128 [REG]Sometimes system will die after tapped close button in an application.
RevBy:
Details:
Not valid pixmap causes exception from qt which is ends up in compositor as
[ 634.029428] Process mcompositor (pid: 774, ti=f3e02000 task=f67265f0
task.ti=f3e02000)
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
BT:
from /usr/lib/libQtGui.so.4
from /usr/lib/libQtGui.so.4
at mtexturepixmapitem_egl.cpp:436
at mtexturepixmapitem_egl.cpp:183
1. Added deinit for MTexturePixmapPrivate::windowp
2. Added Try/catch block for place where the exception comes from
Diffstat (limited to 'src/mtexturepixmapitem_glx.cpp')
-rw-r--r-- | src/mtexturepixmapitem_glx.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mtexturepixmapitem_glx.cpp b/src/mtexturepixmapitem_glx.cpp index 395bb80..5c79790 100644 --- a/src/mtexturepixmapitem_glx.cpp +++ b/src/mtexturepixmapitem_glx.cpp @@ -278,8 +278,10 @@ void MTexturePixmapItem::cleanup() } else glDeleteTextures(1, &d->ctextureId); - if (d->windowp) + if (d->windowp) { XFreePixmap(QX11Info::display(), d->windowp); + d->windowp = 0; + } } void MTexturePixmapItem::updateWindowPixmap(XRectangle *rects, int num, @@ -304,6 +306,7 @@ void MTexturePixmapItem::updateWindowPixmap(XRectangle *rects, int num, GL_RGBA, GL_UNSIGNED_BYTE, img.bits()); } QT_CATCH(std::bad_alloc e) { /* XGetImage() failed, the window has been unmapped. */; + qWarning("MTexturePixmapItem::%s(): std::bad_alloc e", __func__); } } update(); |