diff options
author | Bjørn Erik Nilsen <bjorn.nilsen@nokia.com> | 2010-02-04 10:35:27 (GMT) |
---|---|---|
committer | Bjørn Erik Nilsen <bjorn.nilsen@nokia.com> | 2010-02-04 11:45:18 (GMT) |
commit | 34f1758428282a327c12b0d8040061c1f67ecc7f (patch) | |
tree | ea52dcd00748f18c6382e70902e8ebef6a59ad85 /src | |
parent | 6d1d425e219b0a5e03603f7d708cd740b7d3a3f4 (diff) | |
download | Qt-34f1758428282a327c12b0d8040061c1f67ecc7f.zip Qt-34f1758428282a327c12b0d8040061c1f67ecc7f.tar.gz Qt-34f1758428282a327c12b0d8040061c1f67ecc7f.tar.bz2 |
Crash when closing any top-level widget on Symbian.
The window surface must be deleted while the window is valid because on
some graphics systems a notifcation is sent to the window when the
surface is released.
This fix is also an optmization as we no longer process any backing
store requests while deleting the top-level. Previously it would
handle requests from the window itself and all its children.
Task-number: QT-2513
Reviewed-by: jbarron
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/kernel/qwidget.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index 4054d2a..4520a1b 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -1439,7 +1439,16 @@ QWidget::~QWidget() } #endif - if (QWidgetBackingStore *bs = d->maybeBackingStore()) { + if (d->extra && d->extra->topextra && d->extra->topextra->backingStore) { + // Okay, we are about to destroy the top-level window that owns + // the backing store. Make sure we delete the backing store right away + // before the window handle is invalid. This is important because + // the backing store will delete its window surface, which may or may + // not have a reference to this widget that will be used later to + // notify the window it no longer has a surface. + delete d->extra->topextra->backingStore; + d->extra->topextra->backingStore = 0; + } else if (QWidgetBackingStore *bs = d->maybeBackingStore()) { bs->removeDirtyWidget(this); if (testAttribute(Qt::WA_StaticContents)) bs->removeStaticWidget(this); |