qt6-bb10/tests/auto/widgets
Marc Mutz 080daae7cd Plug new leaks in tst_QFormLayout
The new takeRow() functions return a pair of pointers to
QLayoutItems and, as the name particle 'take' suggests,
releases ownership of these layout items. Which in turn
means that the caller of the function is supposed to deal
with them.

This was not done here.

To fix, write a RAII class that takes ownership of the
returned layout items, deleting them when it goes out of
scope or gets a new value assigned (only move special
member functions are implemented, making the class move
-only).

Deleting the QLayoutItems is not so easy, though:
QFormLayout has a special function for clearing the
QLayoutItems out, so it appears that just calling their
destructors is not going to fly (though I don't know off
the top of the head why that should be a problem).

Solve this, for now, by adding the layout items back into
a temporary QFormLayout for destruction.

Change-Id: If862989207b20f1e3f757c19ec9d498c4491184f
Reviewed-by: Samuel Gaist <samuel.gaist@edeltech.ch>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-10-21 21:49:21 +00:00
..
dialogs Merge remote-tracking branch 'origin/5.7' into 5.8 2016-10-06 20:12:27 +02:00
effects QtWidgets: Remove Windows CE. 2016-04-07 10:24:45 +00:00
gestures autotests: use QTest::createTouchDevice() 2016-06-10 13:07:17 +00:00
graphicsview Change confusing Q_DEAD_CODE_FROM_QT4_FOO define 2016-10-14 08:19:29 +00:00
itemviews Change confusing Q_DEAD_CODE_FROM_QT4_FOO define 2016-10-14 08:19:29 +00:00
kernel Plug new leaks in tst_QFormLayout 2016-10-21 21:49:21 +00:00
styles Merge remote-tracking branch 'origin/5.7' into 5.8 2016-10-06 20:12:27 +02:00
util Merge remote-tracking branch 'origin/5.7' into 5.8 2016-10-06 20:12:27 +02:00
widgets QMenu: don't force platform instance creation on construction 2016-10-16 14:10:29 +00:00
widgets.pro