]> SALOME platform Git repositories - tools/py2cpp.git/commitdiff
Salome HOME
Fix memory leak.
authorOvidiu Mircescu <ovidiu.mircescu@edf.fr>
Mon, 21 Jan 2019 16:31:08 +0000 (17:31 +0100)
committerOvidiu Mircescu <ovidiu.mircescu@edf.fr>
Mon, 21 Jan 2019 16:31:08 +0000 (17:31 +0100)
src/CMakeLists.txt
src/Errors.cxx

index c0d911dc9530b54eea810458ce72b27a55898101..0b05a4cfd405f8107855838943a56f8137b7317d 100644 (file)
@@ -47,7 +47,7 @@ ADD_LIBRARY(py2cpp ${_py2cpp_sources})
 TARGET_LINK_LIBRARIES(py2cpp ${_link_LIBRARIES})
 TARGET_INCLUDE_DIRECTORIES(py2cpp PUBLIC
                           $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
-                          $<INSTALL_INTERFACE:${INSTALL_CMAKE_DIR}/include>)
+                          $<INSTALL_INTERFACE:include>)
 
 INSTALL(TARGETS py2cpp EXPORT FindPy2cpp LIBRARY DESTINATION lib)
 INSTALL(FILES ${_py2cpp_headers} DESTINATION include/py2cpp)
index dfafa5c1e66b14ffb08f2cac5b900cb413088e5a..d6b0d5976cf4741518d49a533fdaa2af7b362a33 100644 (file)
@@ -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);