Merge lp:~aacid/gsettings-qt/disconnect_signal_handler into lp:gsettings-qt
| Status: | Merged |
|---|---|
| Approved by: | Lars Karlitski on 2015-11-30 |
| Approved revision: | 76 |
| Merged at revision: | 78 |
| Proposed branch: | lp:~aacid/gsettings-qt/disconnect_signal_handler |
| Merge into: | lp:gsettings-qt |
| Diff against target: |
27 lines (+3/-1) 1 file modified
src/qgsettings.cpp (+3/-1) |
| To merge this branch: | bzr merge lp:~aacid/gsettings-qt/disconnect_signal_handler |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Lars Karlitski (community) | 2015-11-30 | Approve on 2015-11-30 | |
|
Review via email:
|
|||
Commit Message
Disconnect signal handler on destruction
When running unity8 under valgrind sometimes I get
==31122== Invalid read of size 8
==31122== at 0x620DB42: QMetaObject:
==31122== by 0x1C7C63EE: invokeMethod (qobjectdefs.h:391)
==31122== by 0x1C7C63EE: QGSettingsPriva
==31122== by 0x129DAA59: g_cclosure_
==31122== by 0x129D81D3: _g_closure_
==31122== by 0x129F29D5: g_signal_
==31122== by 0x129F30BE: g_signal_emit (in /usr/lib/
==31122== by 0x138478EB: g_settings_
==31122== by 0x14540D8F: ffi_call_unix64 (in /usr/lib/
==31122== by 0x145407F7: ffi_call (in /usr/lib/
==31122== by 0x129D8CF4: g_cclosure_
==31122== by 0x129D81D3: _g_closure_
==31122== by 0x129F24E7: g_signal_
==31122== Address 0x1dbaa450 is 0 bytes inside a block of size 24 free'd
==31122== at 0x4C2D28B: operator delete(void*) (vg_replace_
==31122== by 0x622CD2A: QObjectPrivate:
==31122== by 0x623661F: QObject::~QObject() (in /usr/lib/
==31122== by 0x1C5BB7AD: ~QQmlElement (qqmlprivate.h:98)
==31122== by 0x1C5BB7AD: QQmlPrivate:
==31122== by 0x622CD2A: QObjectPrivate:
==31122== by 0x623661F: QObject::~QObject() (in /usr/lib/
==31122== by 0x53E886C: QQuickItem:
==31122== by 0x5402DED: ~QQuickRectangle (qquickrectangl
==31122== by 0x5402DED: ~QQmlElement (qqmlprivate.h:98)
==31122== by 0x5402DED: QQmlPrivate:
==31122== by 0x622F66F: QObject:
==31122== by 0x53E66BA: QQuickItem:
==31122== by 0x61FDDE8: QCoreApplicatio
==31122== by 0x61FDF1A: QCoreApplicatio
==31122== Block was alloc'd at
==31122== at 0x4C2C12F: operator new(unsigned long) (vg_replace_
==31122== by 0x1C5BD113: GSettingsQml:
==31122== by 0x5E25421: ??? (in /usr/lib/
==31122== by 0x5DB22E9: ??? (in /usr/lib/
==31122== by 0x5DB2B9E: QQmlEnginePriva
==31122== by 0x5DAE4EB: QQmlComponent:
==31122== by 0x5498859: QQuickLoaderPri
==31122== by 0x54989F7: QQuickLoaderPri
==31122== by 0x5E25421: ??? (in /usr/lib/
==31122== by 0x5DADEAD: QQmlComponentPr
==31122== by 0x5DADF76: QQmlComponentPr
==31122== by 0x5DADDDF: QQmlComponent:
Which as far as i understand means that the QGSettingsPriva
By disconnecting the signal handler I have not been able to reproduce the valgrind warning anymore

Weird. I assumed this cannot happen since we're not passing a ref to the settings object anywhere else and it gets destroyed in the destructor.
Thanks for the catch!