File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -93,11 +93,12 @@ namespace eigenpy
9393 NumpyType ()
9494 {
9595 pyModule = bp::import (" numpy" );
96+ // TODO I don't know why this Py_INCREF is necessary.
97+ // Without it, the destructor of NumpyType SEGV sometimes.
98+ Py_INCREF (pyModule.ptr ());
9699
97100 NumpyMatrixObject = pyModule.attr (" matrix" );
98101 NumpyMatrixType = reinterpret_cast <PyTypeObject*>(NumpyMatrixObject.ptr ());
99- NumpyAsMatrixObject = pyModule.attr (" asmatrix" );
100- NumpyAsMatrixType = reinterpret_cast <PyTypeObject*>(NumpyAsMatrixObject.ptr ());
101102 NumpyArrayObject = pyModule.attr (" ndarray" );
102103 NumpyArrayType = reinterpret_cast <PyTypeObject*>(NumpyArrayObject.ptr ());
103104
@@ -109,7 +110,6 @@ namespace eigenpy
109110
110111 // Numpy types
111112 bp::object NumpyMatrixObject; PyTypeObject * NumpyMatrixType;
112- bp::object NumpyAsMatrixObject; PyTypeObject * NumpyAsMatrixType;
113113 bp::object NumpyArrayObject; PyTypeObject * NumpyArrayType;
114114 };
115115
You can’t perform that action at this time.
0 commit comments