Merge lp:~aacid/unity8/no_model_reset_from_destructor into lp:unity8

Proposed by Albert Astals Cid
Status: Merged
Approved by: Michael Zanetti
Approved revision: 997
Merged at revision: 1007
Proposed branch: lp:~aacid/unity8/no_model_reset_from_destructor
Merge into: lp:unity8
Diff against target: 12 lines (+1/-1)
1 file modified
tests/mocks/Unity/Indicators/fakeindicatorsmodel.cpp (+1/-1)
To merge this branch: bzr merge lp:~aacid/unity8/no_model_reset_from_destructor
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Needs Fixing
Michael Zanetti (community) Approve
Review via email: mp+225127@code.launchpad.net

Commit message

Fix valgrind warning by not emitting reset on model destructor

That won't be supported until Qt 5.4

More info at https://bugreports.qt-project.org/browse/QTBUG-39780

Warning was

==16693== Invalid read of size 8
==16693== at 0x72B19A0: QQmlContext::isValid() const (qqmlcontext.cpp:231)
==16693== by 0x736C82B: QQmlDelegateModelPrivate::emitChanges() (qqmldelegatemodel.cpp:1412)
==16693== by 0x7372AE6: QQmlDelegateModel::_q_modelReset() (qqmldelegatemodel.cpp:1463)
==16693== by 0x7397224: QQmlDelegateModel::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (moc_qqmldelegatemodel_p.cpp:196)
==16693== by 0x739769E: QQmlDelegateModel::qt_metacall(QMetaObject::Call, int, void**) (moc_qqmldelegatemodel_p.cpp:292)
==16693== by 0x66379CC: QMetaObject::activate(QObject*, int, int, void**) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.3.0)
==16693== by 0x65AEEFD: QAbstractItemModel::endResetModel() (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.3.0)
==16693== by 0x23461EFD: FakeIndicatorsModel::unload() (fakeindicatorsmodel.cpp:53)
==16693== by 0x23461E13: FakeIndicatorsModel::~FakeIndicatorsModel() (fakeindicatorsmodel.cpp:34)
==16693== by 0x2345C073: QQmlPrivate::QQmlElement<FakeIndicatorsModel>::~QQmlElement() (in /home/tsdgeos_work/phablet/unity8/investigate_test_shell_crash/builddir/tests/mocks/Unity/Indicators/libIndicatorsFakeQml.so)
==16693== by 0x2345C0A3: QQmlPrivate::QQmlElement<FakeIndicatorsModel>::~QQmlElement() (qqmlprivate.h:106)
==16693== by 0x663636B: QObjectPrivate::deleteChildren() (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.3.0)
==16693== Address 0x1862d448 is 8 bytes inside a block of size 16 free'd
==16693== at 0x4C2C2BC: operator delete(void*) (vg_replace_malloc.c:503)
==16693== by 0x72B21B8: QQmlContextData::destroy() (qqmlcontext.cpp:647)
==16693== by 0x7293458: QQmlPrivate::qdeclarativeelement_destructor(QObject*) (qqmlengine.cpp:612)
==16693== by 0x6C0CADD: QQmlPrivate::QQmlElement<QQuickItem>::~QQmlElement() (qqmlprivate.h:105)
==16693== by 0x663636B: QObjectPrivate::deleteChildren() (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.3.0)
==16693== by 0x663F0EB: QObject::~QObject() (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.3.0)
==16693== by 0x6BF64B5: QQuickItem::~QQuickItem() (qquickitem.cpp:2064)
==16693== by 0x6C0CAE5: QQmlPrivate::QQmlElement<QQuickItem>::~QQmlElement() (qqmlprivate.h:106)
==16693== by 0x663636B: QObjectPrivate::deleteChildren() (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.3.0)
==16693== by 0x663F0EB: QObject::~QObject() (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.3.0)
==16693== by 0x6BF64B5: QQuickItem::~QQuickItem() (qquickitem.cpp:2064)
==16693== by 0x6C0CAE5: QQmlPrivate::QQmlElement<QQuickItem>::~QQmlElement() (qqmlprivate.h:106)

Description of the change

* Are there any related MPs required for this MP to build/function as expected?
No

* Did you perform an exploratory manual test run of your code change and any related functionality?
No, but it's only test code and the valgrind warning is gone

* Did you make sure that your branch does not contain spurious tags?
Yes

* If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
N/A

* If you changed the UI, has there been a design review?
N/A

To post a comment you must log in.
Revision history for this message
Michael Zanetti (mzanetti) wrote :

 * Did you perform an exploratory manual test run of the code change and any related functionality?

yes

 * Did CI run pass? If not, please explain why.

waiting...

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/mocks/Unity/Indicators/fakeindicatorsmodel.cpp'
2--- tests/mocks/Unity/Indicators/fakeindicatorsmodel.cpp 2014-03-03 12:01:09 +0000
3+++ tests/mocks/Unity/Indicators/fakeindicatorsmodel.cpp 2014-07-01 09:58:18 +0000
4@@ -31,7 +31,7 @@
5 /*! \internal */
6 FakeIndicatorsModel::~FakeIndicatorsModel()
7 {
8- unload();
9+ qDeleteAll(m_indicators);
10 }
11
12 int FakeIndicatorsModel::count() const

Subscribers

People subscribed via source and target branches