summaryrefslogtreecommitdiffstats
path: root/tests/auto/qgraphicslinearlayout
diff options
context:
space:
mode:
authorAndreas Aardal Hanssen <andreas.hanssen@tandberg.com>2010-07-14 12:02:08 +0200
committerJan-Arve Sæther <jan-arve.saether@nokia.com>2010-07-14 12:02:08 +0200
commitea6a5146397b668bf535ee7249bd4262d6185234 (patch)
tree456252b438bc52e989a562dae7a364c979177ed0 /tests/auto/qgraphicslinearlayout
parent213eb572f1902550e36f7e677733aba8d066d94b (diff)
Work around memory leak issue in grid and linear layouts.
These classes create a new QWidget and assign it to a static pointer which is never cleaned up. Using Q_GLOBAL_STATIC ensures that they are deleted on library unload. This is really just a cosmetic change that removes a leak warning - the real fix should be to find a way to not use a new QWidget like this. It seems odd that QGraphicsLayouts, which don't use QWidget in any other way, should depend on QWidget like this. Task-number: QTBUG-10768 Merge-request: 741 Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
Diffstat (limited to 'tests/auto/qgraphicslinearlayout')
-rw-r--r--tests/auto/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/auto/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp b/tests/auto/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp
index c26e5d4aec..6107fa11e7 100644
--- a/tests/auto/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp
+++ b/tests/auto/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp
@@ -102,6 +102,7 @@ private slots:
void layoutDirection();
void removeLayout();
void avoidRecursionInInsertItem();
+ void styleInfoLeak();
// Task specific tests
void task218400_insertStretchCrash();
@@ -1443,6 +1444,12 @@ void tst_QGraphicsLinearLayout::avoidRecursionInInsertItem()
QCOMPARE(layout->count(), 0);
}
+void tst_QGraphicsLinearLayout::styleInfoLeak()
+{
+ QGraphicsLinearLayout layout;
+ layout.spacing();
+}
+
void tst_QGraphicsLinearLayout::task218400_insertStretchCrash()
{
QGraphicsScene *scene = new QGraphicsScene;