From: Ovidiu Mircescu Date: Mon, 21 Jan 2019 16:31:08 +0000 (+0100) Subject: Fix memory leak. X-Git-Tag: v1.0~7 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=70e5adacf069070c8cb968726cb185c1a63acd39;p=tools%2Fpy2cpp.git Fix memory leak. --- diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c0d911d..0b05a4c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -47,7 +47,7 @@ ADD_LIBRARY(py2cpp ${_py2cpp_sources}) TARGET_LINK_LIBRARIES(py2cpp ${_link_LIBRARIES}) TARGET_INCLUDE_DIRECTORIES(py2cpp PUBLIC $ - $) + $) INSTALL(TARGETS py2cpp EXPORT FindPy2cpp LIBRARY DESTINATION lib) INSTALL(FILES ${_py2cpp_headers} DESTINATION include/py2cpp) diff --git a/src/Errors.cxx b/src/Errors.cxx index dfafa5c..d6b0d59 100644 --- a/src/Errors.cxx +++ b/src/Errors.cxx @@ -105,6 +105,7 @@ void ConversionCheck::addError(const std::string& expectedType, PyObject * obj) pyRepr = PyUnicode_AsUTF8(pyResult); else pyRepr = "unknown representation"; + Py_XDECREF(pyResult); if(pyRepr.size() > 80) { pyRepr = pyRepr.substr(0, 76);