summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/util/qcompleter
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2016-09-28 10:49:57 +0200
committerMarc Mutz <marc.mutz@kdab.com>2016-10-02 11:28:23 +0000
commitad1555be7fa2aa9da04509455f83f5d8faab6e3a (patch)
tree847246ec5696c72b6811c6e8250b679cc48a6a0f /tests/auto/widgets/util/qcompleter
parentf43c9697bcae997be3eb6db9504f3d7b64601148 (diff)
Plug remaining leaks in tests/auto/widgets/util
In tst_QCompleter, two completers were leaked because they had no parent and setCompleter() calls don't reparent. Fixed by giving them parents. In tst_QUndo*, fix lots of leaked QActions by storing them in a QScopedPointer. There were some half-hearted attempts to clean them up with manual deletes, but I ported these to scoped pointers, too, to make the code more robust in the face of failures. This fixes the remaining errors in GCC 6.1 Linux ASan runs of tests/auto/widgets/util. Change-Id: Icc5248cc9cf4514540915924df1c4d9e09c071fa Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'tests/auto/widgets/util/qcompleter')
-rw-r--r--tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp b/tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp
index 86a0bdf901..2a14d752e1 100644
--- a/tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp
+++ b/tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp
@@ -1228,7 +1228,7 @@ void tst_QCompleter::task178797_activatedOnReturn()
words << "foobar1" << "foobar2";
QLineEdit ledit;
setFrameless(&ledit);
- QCompleter *completer = new QCompleter(words);
+ QCompleter *completer = new QCompleter(words, &ledit);
ledit.setCompleter(completer);
QSignalSpy spy(completer, SIGNAL(activated(QString)));
QCOMPARE(spy.count(), 0);
@@ -1335,7 +1335,7 @@ public:
task250064_TextEdit()
{
- completer = new QCompleter;
+ completer = new QCompleter(this);
completer->setWidget(this);
}