summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Barron <jason.barron@nokia.com>2010-10-08 09:39:49 (GMT)
committerJason Barron <jason.barron@nokia.com>2010-10-12 09:10:28 (GMT)
commit1113344ece060bb7386ea540becbf59f9c8320ea (patch)
tree88e903d981b72b42fdb20c62c0ff1cdac54acd79 /src
parent1192782e688f04e6e0d86e7c311afe79eb04ab5b (diff)
downloadQt-1113344ece060bb7386ea540becbf59f9c8320ea.zip
Qt-1113344ece060bb7386ea540becbf59f9c8320ea.tar.gz
Qt-1113344ece060bb7386ea540becbf59f9c8320ea.tar.bz2
Crash fix when using the runtime graphics system on Symbian.
If QWidget::destroy() is called (perhaps by setParent) then the window surface is deleted by the destructor of QSymbianControl instead of in the "normal" place which is ~QWidget(). This means that we should not attempt to use the RWindow in the window surface because it is in the process of being destroyed. Reviewed-by: Jani Hautakangas
Diffstat (limited to 'src')
-rw-r--r--src/gui/painting/qwindowsurface_s60.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/gui/painting/qwindowsurface_s60.cpp b/src/gui/painting/qwindowsurface_s60.cpp
index 8bac1f5..ea19fcd 100644
--- a/src/gui/painting/qwindowsurface_s60.cpp
+++ b/src/gui/painting/qwindowsurface_s60.cpp
@@ -101,9 +101,11 @@ QS60WindowSurface::~QS60WindowSurface()
// Issue empty redraw to clear the UI surface
QWidget *w = window();
- RWindow *const window = static_cast<RWindow *>(w->winId()->DrawableWindow());
- window->BeginRedraw();
- window->EndRedraw();
+ if (w->testAttribute(Qt::WA_WState_Created)) {
+ RWindow *const window = static_cast<RWindow *>(w->winId()->DrawableWindow());
+ window->BeginRedraw();
+ window->EndRedraw();
+ }
}
}
#endif