diff options
author | Aleksandar Stojiljkovic <aleksandar.stojiljkovic@nokia.com> | 2011-07-18 05:46:01 (GMT) |
---|---|---|
committer | Aleksandar Stojiljkovic <aleksandar.stojiljkovic@nokia.com> | 2011-07-18 05:46:01 (GMT) |
commit | b5d357d63aeb28b8be62f1a3004a6a7969c7a81e (patch) | |
tree | b4c17acd6ab5db0d4541b37ac7b694198c2a8d08 /src | |
parent | c0772f44fb1d53608ff629fc622103698c6d0ee5 (diff) | |
download | Qt-b5d357d63aeb28b8be62f1a3004a6a7969c7a81e.zip Qt-b5d357d63aeb28b8be62f1a3004a6a7969c7a81e.tar.gz Qt-b5d357d63aeb28b8be62f1a3004a6a7969c7a81e.tar.bz2 |
Fixes leaking X11 SyncCounter when widgets get open/destroyed
xmeminfo showed leaking memory and unreleased X11 SyncCounter for test application opening and destroying one QWidget.
It was not that critical: on 1000+ openings, heap grew ~4MB. This patch fixes the leak.
Reviewed-by: Samuel Rødal
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/kernel/qwidget_x11.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gui/kernel/qwidget_x11.cpp b/src/gui/kernel/qwidget_x11.cpp index a3173eb..65d9837 100644 --- a/src/gui/kernel/qwidget_x11.cpp +++ b/src/gui/kernel/qwidget_x11.cpp @@ -2827,6 +2827,12 @@ void QWidgetPrivate::deleteTLSysExtra() { // don't destroy input context here. it will be destroyed in // QWidget::destroy() destroyInputContext(); +#ifndef QT_NO_XSYNC + if (extra && extra->topextra && extra->topextra->syncUpdateCounter) { + XSyncDestroyCounter(X11->display, extra->topextra->syncUpdateCounter); + extra->topextra->syncUpdateCounter = 0; + } +#endif } void QWidgetPrivate::registerDropSite(bool on) |