diff options
author | Olivier Goffart <ogoffart@woboq.com> | 2014-08-08 13:53:14 +0200 |
---|---|---|
committer | Olivier Goffart <ogoffart@woboq.com> | 2014-08-09 08:31:20 +0200 |
commit | 3750c677ee4cac5525f9c7be3978173037dd089d (patch) | |
tree | f606cf7dc5b5448eac3c63c84d114373de3e1705 /src/corelib/kernel/qobject_p.h | |
parent | 6f1299c0b44c969137d28da346fc6539aac20f3b (diff) |
QObject: fix valgrind warning when disconnecting
QObjectPrivate::Connection::method should never be called when
the Connection was made with the function pointer syntax
This caused valgrind warning about using uninitialized value on such code:
QObject::connect(&o, &Object::aSignal, &o, &Object::aSlot);
o.disconnect(&o, SLOT(aSlot()));
Change-Id: Iaff9ecd3ddfe665db92726b420021493453c4cea
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/kernel/qobject_p.h')
-rw-r--r-- | src/corelib/kernel/qobject_p.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/kernel/qobject_p.h b/src/corelib/kernel/qobject_p.h index 180887b370..95d64873e0 100644 --- a/src/corelib/kernel/qobject_p.h +++ b/src/corelib/kernel/qobject_p.h @@ -149,7 +149,7 @@ public: //ref_ is 2 for the use in the internal lists, and for the use in QMetaObject::Connection } ~Connection(); - int method() const { return method_offset + method_relative; } + int method() const { Q_ASSERT(!isSlotObject); return method_offset + method_relative; } void ref() { ref_.ref(); } void deref() { if (!ref_.deref()) { |