summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/wayland/qwaylandshmbackingstore.cpp
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.p.agocs@nokia.com>2012-04-13 11:57:22 +0300
committerJørgen Lind <jorgen.lind@nokia.com>2012-04-17 13:08:40 +0200
commit801b800cd2baffa9d3080ec3184ffd1af6b9bde8 (patch)
treec605eeea843aa4b055869117bc653c58ce0befd1 /src/plugins/platforms/wayland/qwaylandshmbackingstore.cpp
parent9490aec9c20d893772b7f4be03e8d4697fc117a4 (diff)
Do not crash when closing pop-ups in widget apps.
The shm frame callback has to be destroyed otherwise the callback will occur after the dtor. Also, start using the previously unused 'window' variable in the callback. Change-Id: Iace09ae981344dcbe4112f49fcd19491963e4668 Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
Diffstat (limited to 'src/plugins/platforms/wayland/qwaylandshmbackingstore.cpp')
-rw-r--r--src/plugins/platforms/wayland/qwaylandshmbackingstore.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/plugins/platforms/wayland/qwaylandshmbackingstore.cpp b/src/plugins/platforms/wayland/qwaylandshmbackingstore.cpp
index 0d4d06f82..5858f2478 100644
--- a/src/plugins/platforms/wayland/qwaylandshmbackingstore.cpp
+++ b/src/plugins/platforms/wayland/qwaylandshmbackingstore.cpp
@@ -135,6 +135,9 @@ QWaylandShmBackingStore::QWaylandShmBackingStore(QWindow *window)
QWaylandShmBackingStore::~QWaylandShmBackingStore()
{
+ if (mFrameCallback)
+ wl_callback_destroy(mFrameCallback);
+
// if (mFrontBuffer == waylandWindow()->attached())
// waylandWindow()->attach(0);
@@ -269,16 +272,16 @@ void QWaylandShmBackingStore::done(void *data, wl_callback *callback, uint32_t t
QWaylandWindow *window = self->waylandWindow();
wl_callback_destroy(self->mFrameCallback);
self->mFrameCallback = 0;
- if (self->mFrontBuffer != self->waylandWindow()->attached()) {
- delete self->waylandWindow()->attached();
- self->waylandWindow()->attach(self->mFrontBuffer);
+ if (self->mFrontBuffer != window->attached()) {
+ delete window->attached();
+ window->attach(self->mFrontBuffer);
}
if (self->mFrontBufferIsDirty && !self->mPainting) {
self->mFrontBufferIsDirty = false;
- self->mFrameCallback = wl_surface_frame(self->waylandWindow()->wl_surface());
+ self->mFrameCallback = wl_surface_frame(window->wl_surface());
wl_callback_add_listener(self->mFrameCallback,&self->frameCallbackListener,self);
- self->waylandWindow()->damage(QRect(QPoint(0,0),self->mFrontBuffer->size()));
+ window->damage(QRect(QPoint(0,0),self->mFrontBuffer->size()));
}
}