Problem deriving classes in LUA and deleting it in C++

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

Problem deriving classes in LUA and deleting it in C++

"Голубев С.В."
Hello.

I creating class in C++ and binding it as shown:

C++:

class ww_dialog {
public:
    ww_dialog(void);
};
module(xState) [
    class_<ww_dialog>("ww_dialog")
       .def(constructor<>())
];

In my script i want to be able to derive LUA class from a C++ class, but
I don't want to garbage collecting derived class in by LUA garbage
collector. With this code I receive a SIGSEGV when I deleting LUA class
instances in a C++ and when i destroying LUA state. I am a newbie in
luabind, can you help me more descriptive?

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
luabind-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/luabind-user
Reply | Threaded
Open this post in threaded view
|

Re: Problem deriving classes in LUA and deleting it in C++

Dmitriy Iassenev
ГСВ> I creating class in C++ and binding it as shown:

ГСВ> C++:

ГСВ> class ww_dialog {
ГСВ> public:
ГСВ>     ww_dialog(void);
ГСВ> };
ГСВ> module(xState) [
ГСВ>     class_<ww_dialog>("ww_dialog")
ГСВ>        .def(constructor<>())
ГСВ> ];

ГСВ> In my script i want to be able to derive LUA class from a C++ class, but
ГСВ> I don't want to garbage collecting derived class in by LUA garbage
ГСВ> collector. With this code I receive a SIGSEGV when I deleting LUA class
ГСВ> instances in a C++ and when i destroying LUA state. I am a newbie in
ГСВ> luabind, can you help me more descriptive?
pass instance of the newly created class instance to C++ via function
with adopt policy

to Arvid & Daniel: is it possible to export constructor of a class with
adopt policy?

--
Best regards,
 Dmitriy                            mailto:[hidden email]


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
luabind-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/luabind-user