← Back to team overview

yade-dev team mailing list archive

Re: [Branch ~yade-dev/yade/trunk] Rev 2344: - miniEigen : memory leak source suspected (FIXME added)

 

Václav Šmilauer said:     (by the date of Mon, 12 Jul 2010 14:07:56 +0200)

> > .def("__init__",bp::make_constructor(&Quaternionr_fromAxisAngle,bp::default_call_policies(),(bp::arg("axis"),bp::arg("angle"))))
> > .def("__init__",bp::make_constructor(&Quaternionr_fromAngleAxis,bp::default_call_policies(),(bp::arg("angle"),bp::arg("axis"))))
> Oh, I get it. the make_constructor function is supposed to return
> pointer to the new object, make_constructor supplies its own return
> policy... it is not completely clear to me (documentation is sparse on
> the subject), but I think it is OK.

thank you for checking this. Can you add a comment in the source about this?

looks like it can be used:

https://svn.boost.org/trac/boost/ticket/770

too little here, though:

http://www.boost.org/doc/libs/1_43_0/libs/python/doc/v2/make_function.html#make_constructor-spec

hmm.. but look, here they are using a shared_ptr (but I doubt this
could work with a quaternion?)

http://wiki.python.org/moin/boost.python/HowTo#namedconstructors.2BAC8factories.28asPythoninitializers.29

-- 
Janek Kozicki                               http://janek.kozicki.pl/  |



Follow ups

References