Adopt policy

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Adopt policy

Alexander Gladysh
Hi, all!

The Luabind manual gives following example on adopt policy:

  X* create() { return new X; }
  module(L) [ def("create", &create, adopt(result)) ];

In which way object, returned by create() will be destroyed? Would Lua
(5.1.1) itself deallocate memory with it's allocator (which is, by
default, AFAIR, the realloc function), or would Luabind call delete on
the passed pointer?

Thanks in advance,

Take Surveys. Earn Cash. Influence the Future of IT
Join's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
luabind-user mailing list
[hidden email]