Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Stack Of Tasks
eigenpy
Commits
c2608e84
Unverified
Commit
c2608e84
authored
Dec 10, 2019
by
Justin Carpentier
Committed by
GitHub
Dec 10, 2019
Browse files
Merge pull request #140 from jcarpent/devel
Fix potential memory leak issue
parents
17400308
5ab1f167
Changes
1
Hide whitespace changes
Inline
Side-by-side
include/eigenpy/details.hpp
View file @
c2608e84
...
...
@@ -16,6 +16,17 @@
#include
"eigenpy/registration.hpp"
#include
"eigenpy/map.hpp"
namespace
boost
{
namespace
python
{
namespace
detail
{
template
<
class
MatType
>
struct
referent_size
<
Eigen
::
MatrixBase
<
MatType
>&>
{
BOOST_STATIC_CONSTANT
(
std
::
size_t
,
value
=
sizeof
(
MatType
));
};
}}}
namespace
boost
{
namespace
python
{
namespace
converter
{
template
<
class
MatType
>
...
...
@@ -67,7 +78,8 @@ struct implicit<MatType,Eigen::MatrixBase<MatType> >
static
void
construct
(
PyObject
*
obj
,
rvalue_from_python_stage1_data
*
data
)
{
void
*
storage
=
((
rvalue_from_python_storage
<
Source
>*
)
data
)
->
storage
.
bytes
;
void
*
storage
=
reinterpret_cast
<
rvalue_from_python_storage
<
Target
>*>
(
reinterpret_cast
<
void
*>
(
data
))
->
storage
.
bytes
;
arg_from_python
<
Source
>
get_source
(
obj
);
bool
convertible
=
get_source
.
convertible
();
...
...
@@ -565,8 +577,8 @@ namespace eigenpy
PyArrayObject
*
pyArray
=
reinterpret_cast
<
PyArrayObject
*>
(
pyObj
);
assert
((
PyArray_DIMS
(
pyArray
)[
0
]
<
INT_MAX
)
&&
(
PyArray_DIMS
(
pyArray
)[
1
]
<
INT_MAX
));
void
*
storage
=
((
bp
::
converter
::
rvalue_from_python_storage
<
MatType
>*
)
((
void
*
)
memory
))
->
storage
.
bytes
;
void
*
storage
=
reinterpret_cast
<
bp
::
converter
::
rvalue_from_python_storage
<
MatType
>*
>
(
reinterpret_cast
<
void
*
>
(
memory
))
->
storage
.
bytes
;
EigenObjectAllocator
<
MatType
>::
allocate
(
pyArray
,
storage
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment