summaryrefslogtreecommitdiffstats
path: root/libpyside
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2011-08-26 18:42:26 -0300
committerRenato Filho <renato.filho@openbossa.org>2011-08-29 18:44:07 -0300
commitfe821e16f8c76ed9251377734e81c92c9edebaaf (patch)
treed80a7e673637f64c3b78f76f8a3a3d48daf16d38 /libpyside
parent657f9d5ff1134b31d14094ddbe0b6dc75fd586a4 (diff)
downloadpyside-fe821e16f8c76ed9251377734e81c92c9edebaaf.tar.gz
pyside-fe821e16f8c76ed9251377734e81c92c9edebaaf.tar.xz
pyside-fe821e16f8c76ed9251377734e81c92c9edebaaf.zip
Fixed SignalManager bug during anonymous signal connection.
Reviewed by: Hugo Parente <hugo.lima@openbossa.org> Luciano Wolf <luciano.wolf@openbossa.org>
Diffstat (limited to 'libpyside')
-rw-r--r--libpyside/signalmanager.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/libpyside/signalmanager.cpp b/libpyside/signalmanager.cpp
index bd455c9..002d8f9 100644
--- a/libpyside/signalmanager.cpp
+++ b/libpyside/signalmanager.cpp
@@ -275,10 +275,12 @@ QObject* SignalManager::globalReceiver(QObject *sender, PyObject *callback)
SharedMap globalReceivers = m_d->m_globalReceivers;
QByteArray hash = GlobalReceiverV2::hash(callback);
GlobalReceiverV2* gr = 0;
- if (!globalReceivers->contains(hash) && sender) {
+ if (!globalReceivers->contains(hash)) {
gr = (*globalReceivers)[hash] = new GlobalReceiverV2(callback, globalReceivers);
- gr->incRef(sender); // create a link reference
- gr->decRef(); // remove extra reference
+ if (sender) {
+ gr->incRef(sender); // create a link reference
+ gr->decRef(); // remove extra reference
+ }
} else {
gr = (*globalReceivers)[hash];
if (sender)