in tolua++ 1.0.92 samples,"tclass",I make the pkg "tclassbind.cpp" and compile successfully,everything is ok when it runs to the luaL_dofile(L,"tclass.lua") but the app crashed at lua_close(), heap may be crashed because of "tclass.exe" or the Dlls it used.
if I remove "tolua_tclass_open(L)" ,not to register my class to lua,everything is right. Why?
I have tried to set up a new simple class,but the result is the same.
//by the way: I want to ask the CEGUI author a question why you chose tolua++ not luabind or luaWrapper as the script, we have to write pkg and lua files by ourselves when we use lua,it seems a little inconvenient
can not use class in tolua++,crash at lua_close()
Moderators: CEGUI MVP, CEGUI Team
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Re: can not use class in tolua++,crash at lua_close()
I'm not sure about the issue. Are you using our version of tolua++? Our version is slightly modified, and I'm not sure what happens if you use both that and the 'official' release together at the same time.
Back in the day, when I first did what were essentially tech demos / tests for CEGUI Mk-2 the scripting support was in fact done via luabind. As I recall some of the intermediate output generated by this were huge, and as such there were issues compiling on the systems we supported at the time. In addition to this it would take forever to compile, and many were not happy about the reliance on boost.
Lindquist's scripting module implemented using tolua++ was really compact, flexible, reasonably easy to maintain and control, and so was adopted as the official Lua based scripting module.
I've never heard of luaWrapper.
Don't forget that you are free to create a scripting module using whichever system you desire - the one we supply can be considered as just an example.
CE.
kidcdf wrote://by the way: I want to ask the CEGUI author a question why you chose tolua++ not luabind or luaWrapper as the script, we have to write pkg and lua files by ourselves when we use lua,it seems a little inconvenient
Back in the day, when I first did what were essentially tech demos / tests for CEGUI Mk-2 the scripting support was in fact done via luabind. As I recall some of the intermediate output generated by this were huge, and as such there were issues compiling on the systems we supported at the time. In addition to this it would take forever to compile, and many were not happy about the reliance on boost.
Lindquist's scripting module implemented using tolua++ was really compact, flexible, reasonably easy to maintain and control, and so was adopted as the official Lua based scripting module.
I've never heard of luaWrapper.
Don't forget that you are free to create a scripting module using whichever system you desire - the one we supply can be considered as just an example.
CE.
Re: can not use class in tolua++,crash at lua_close()
CrazyEddie wrote:I'm not sure about the issue. Are you using our version of tolua++? Our version is slightly modified, and I'm not sure what happens if you use both that and the 'official' release together at the same time.kidcdf wrote://by the way: I want to ask the CEGUI author a question why you chose tolua++ not luabind or luaWrapper as the script, we have to write pkg and lua files by ourselves when we use lua,it seems a little inconvenient
Back in the day, when I first did what were essentially tech demos / tests for CEGUI Mk-2 the scripting support was in fact done via luabind. As I recall some of the intermediate output generated by this were huge, and as such there were issues compiling on the systems we supported at the time. In addition to this it would take forever to compile, and many were not happy about the reliance on boost.
Lindquist's scripting module implemented using tolua++ was really compact, flexible, reasonably easy to maintain and control, and so was adopted as the official Lua based scripting module.
I've never heard of luaWrapper.
Don't forget that you are free to create a scripting module using whichever system you desire - the one we supply can be considered as just an example.
CE.
thank u.
Can you take one minute to try the "tclass" sample in tolua++ tests directory? I have sent email to tolua++'s author,for there is no forum or wiki for tolua++ to get help from.
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
I've looked at the files for the test. I do not understand what you are trying to do here. I do not understand how this relates to CEGUI.
Please post some relevant information; exactly what you're trying to do, how you have structured your code, what you expected to happen, and how what actually happens differs from what you were expecting.
CE.
Please post some relevant information; exactly what you're trying to do, how you have structured your code, what you expected to happen, and how what actually happens differs from what you were expecting.
CE.
CrazyEddie wrote:I've looked at the files for the test. I do not understand what you are trying to do here. I do not understand how this relates to CEGUI.
Please post some relevant information; exactly what you're trying to do, how you have structured your code, what you expected to happen, and how what actually happens differs from what you were expecting.
CE.
I am sorry to make you confused.
Now I can easily use ceguilua to accomplish cegui scripts function without learning tolua++. But I am not satisfied with it,I want to use ogre objects in lua,too,and why not continue to use tolua++? So I began to study tolua++ in order to use ogre in lua. yeah,I just ask the tolua++ questions here because there is no tolua++ forum and wiki.
I have changed the tolua++ sdk which cegui used, but the problem is the same. If I remove"lua_close(L)" in the end ,everthing is allright,and the lua script can be normally executed. someone told that maybe the lua object is deleted twice, but the following codes also failed:
//tolua++1.0.92 & lua 5.12 sdk
lua_State* L = lua_open();
luaL_openlibs(L);
tolua_open(L);
lua_close(L); //heap is destoryed,the app crashes
debug info:
HEAP[Kid.exe]: Invalid Address specified to RtlValidateHeap( 00480000, 003F5C10 )
Isn't it ridiculous??
- scriptkid
- Home away from home
- Posts: 1178
- Joined: Wed Jan 12, 2005 12:06
- Location: The Hague, The Netherlands
- Contact:
A short while ago someone i know encountered the same issue, because of different lua versions between Cegui and his own app. But it seems that you are including and linking to the same one lua version, aren't you?
His errors matched yours alot...
Maybe you can double-check? Maybe some old lua stuff on your path settings or in Visual Studio?
HTH.
His errors matched yours alot...
Maybe you can double-check? Maybe some old lua stuff on your path settings or in Visual Studio?
HTH.
Check out my released snake game using Cegui!
Return to “Modifications / Integrations / Customisations”
Who is online
Users browsing this forum: Bing [Bot] and 10 guests