diff options
author | Jason Barron <jason.barron@nokia.com> | 2010-10-08 09:39:49 (GMT) |
---|---|---|
committer | Jason Barron <jason.barron@nokia.com> | 2010-10-12 09:10:28 (GMT) |
commit | 1113344ece060bb7386ea540becbf59f9c8320ea (patch) | |
tree | 88e903d981b72b42fdb20c62c0ff1cdac54acd79 /src/gui/painting/qwindowsurface_s60.cpp | |
parent | 1192782e688f04e6e0d86e7c311afe79eb04ab5b (diff) | |
download | Qt-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/gui/painting/qwindowsurface_s60.cpp')
-rw-r--r-- | src/gui/painting/qwindowsurface_s60.cpp | 8 |
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 |