summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/PluginAlgorithm.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/PluginAlgorithm.cpp b/src/PluginAlgorithm.cpp
index 5d6d733..4066e30 100644
--- a/src/PluginAlgorithm.cpp
+++ b/src/PluginAlgorithm.cpp
@@ -290,12 +290,14 @@ std::string CPluginAlgorithmFactory::getHelp(std::string name){
if(inspect!=NULL && six!=NULL){
PyObject *retVal = PyObject_CallMethod(inspect,"getdoc","O",pyclass);
if(retVal!=NULL){
- PyObject *retb = PyObject_CallMethod(six,"b","O",retVal);
- Py_DECREF(retVal);
- if(retb!=NULL){
- ret = std::string(PyBytes_AsString(retb));
- Py_DECREF(retb);
+ if(retVal!=Py_None){
+ PyObject *retb = PyObject_CallMethod(six,"b","O",retVal);
+ if(retb!=NULL){
+ ret = std::string(PyBytes_AsString(retb));
+ Py_DECREF(retb);
+ }
}
+ Py_DECREF(retVal);
}else{
logPythonError();
}