Support nil parameter when using adopt policy

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:

https://github.com/vilarion/luabind/commit/b8ef90f2cecc5241121d8b0bca85a67a57d287b3

Best regards,
Andreas


------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://ad.doubleclick.net/clk;258768047;13503038;j?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html
_______________________________________________
luabind-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/luabind-user

smime.p7s (2K) Download Attachment