summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLauro Neto <lauro.neto@openbossa.org>2011-10-18 15:07:54 -0300
committerLauro Neto <lauro.neto@openbossa.org>2011-10-18 15:27:57 -0300
commitaa8519d0a3cb9dd5ede9f3920310b17bcd074841 (patch)
tree282108eb0d4320248f037b3fb9f7749269a31435
parent89baf69998a4fcc3cd4eb3710f652c452224e2fa (diff)
downloadpyside-aa8519d0a3cb9dd5ede9f3920310b17bcd074841.tar.gz
pyside-aa8519d0a3cb9dd5ede9f3920310b17bcd074841.tar.xz
pyside-aa8519d0a3cb9dd5ede9f3920310b17bcd074841.zip
Fix getTypeName check order.
Was segfaulting for signals with None as an explicit argument (returning NULL to a strdup). Reviewer: Hugo Lima <hugo.lima@openbossa.org> Reviewer: Marcelo Lira <marcelo.lira@openbossa.org>
-rw-r--r--libpyside/pysidesignal.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/libpyside/pysidesignal.cpp b/libpyside/pysidesignal.cpp
index e3a2103..53c5814 100644
--- a/libpyside/pysidesignal.cpp
+++ b/libpyside/pysidesignal.cpp
@@ -585,10 +585,10 @@ char* getTypeName(PyObject* type)
typeName = strdup("PyObject");
}
return typeName;
+ } else if (type == Py_None) { // Must be checked before as Shiboken::String::check accepts Py_None
+ return strdup("void");
} else if (Shiboken::String::check(type)) {
return strdup(Shiboken::String::toCString(type));
- } else if (type == Py_None) {
- return strdup("void");
}
return 0;
}