diff options
author | Gareth Stockwell <ext-gareth.stockwell@nokia.com> | 2011-08-11 12:58:23 (GMT) |
---|---|---|
committer | Gareth Stockwell <ext-gareth.stockwell@nokia.com> | 2011-08-31 09:17:34 (GMT) |
commit | 298d7a2032c0c6de06c82afc8e9f7356cb5d7840 (patch) | |
tree | b7dc09a7f0934920c6d03c8e2f383347b464f6d9 /src/gui/kernel/qwidget.h | |
parent | 91096126440aafba22aeb9307cb72135b3156a4c (diff) | |
download | Qt-298d7a2032c0c6de06c82afc8e9f7356cb5d7840.zip Qt-298d7a2032c0c6de06c82afc8e9f7356cb5d7840.tar.gz Qt-298d7a2032c0c6de06c82afc8e9f7356cb5d7840.tar.bz2 |
Prevent leakage of native window handles
On Symbian, reparenting a native widget causes its native window,
and those of all its ancestors, to be destroyed and recreated.
Because native window handles cannot be destroyed from the context
of CONE event handlers, the destruction is delayed until after
control flow returns to the event loop (see QTBUG-4664).
However, the pending-destruction native windows are leaked if
either of the following happens:
a) The application never returns to the event loop. While unlikely
in a real app, this situation does happen in Qt autotests, causing
a crash in tst_qwidget due to leakage from
tst_QWidget::reparentCausesChildWinIdChange().
b) A subsequent reparenting event occurs before control returns to
the event loop.
This patch prevents the leak by storing the pending-destruction
native window handle(s) in a member QList, rather than on the stack
as parameters to QWidgetPrivate::_q_delayedDestroy(WId).
Task-number: QT-5135
Reviewed-by: Jani Hautakangas
Diffstat (limited to 'src/gui/kernel/qwidget.h')
-rw-r--r-- | src/gui/kernel/qwidget.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/kernel/qwidget.h b/src/gui/kernel/qwidget.h index 2c89405..2f8545e 100644 --- a/src/gui/kernel/qwidget.h +++ b/src/gui/kernel/qwidget.h @@ -787,7 +787,7 @@ private: Q_DISABLE_COPY(QWidget) Q_PRIVATE_SLOT(d_func(), void _q_showIfNotHidden()) #ifdef Q_OS_SYMBIAN - Q_PRIVATE_SLOT(d_func(), void _q_delayedDestroy(WId winId)) + Q_PRIVATE_SLOT(d_func(), void void _q_cleanupWinIds()) #endif QWidgetData *data; |