diff options
author | Bjørn Erik Nilsen <bjorn.nilsen@nokia.com> | 2010-02-04 10:35:27 (GMT) |
---|---|---|
committer | Jason McDonald <jason.mcdonald@nokia.com> | 2010-02-09 16:19:24 (GMT) |
commit | a904af2eaf9ab1290730ae76bfa59c3768ff0ebe (patch) | |
tree | 7fb57187843408ec54a575b524f72fd23fc4294f | |
parent | d2c449adaa3169db0e5f87aa9a9961775bbac60f (diff) | |
download | Qt-a904af2eaf9ab1290730ae76bfa59c3768ff0ebe.zip Qt-a904af2eaf9ab1290730ae76bfa59c3768ff0ebe.tar.gz Qt-a904af2eaf9ab1290730ae76bfa59c3768ff0ebe.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
(cherry picked from commit 34f1758428282a327c12b0d8040061c1f67ecc7f)
-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 5c2015a..121b7ee 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); |