Support nil parameter when using adopt policy

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

Support nil parameter when using adopt policy

Andreas Grob-4
Hello all,

for some time my application had problems with the luabind::adopt policy
when nil was passed via the specified parameter. This results in a crash
in luabind-0.9.1.

The typical use case is an object that is contructed in Lua but
ownership has to be passed on to C++, because the object needs to be
stored there for whatever reason. The scripts can usually be edited by a
broader team and the application crashing because someone over there
makes a mistake is not really an option, because it leaves them
clueless. Most likely you want to report the error instead.  Of course
you could circumvent this issue with creator methods, but still the
straight forward approach should work in all cases, I think.

It seems that this is a bug in luabind, so I patched it for me. In case
you are interested and also for future reference, here is the fix I
pushed to github:

Best regards,

Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:;258768047;13503038;j?
luabind-user mailing list
[hidden email]

smime.p7s (2K) Download Attachment