From: Paul K <pau...@ya...> - 2012-09-17 17:34:15
|
Hi Victor, > I have always wanted to require wx in a lane but because of "only once" dll > initialization it does not work. I am able to require wx from a lane if it > has not been required from the "main" lua_State. I might have seen a similar issue, but for a different reason: I wanted to be able to load and run wx from a co-routine. We had a discussion with John couple of months ago as to why this may not be working with wxlua 2.8.12 (even though it was working before with 2.8.7 and 2.8.10). You can see the discussion here: http://www.mail-archive.com/wxl...@li.../msg03010.html. Essentially, there was a fix that was applied in rev100 (in svn), which was then partially rolled back in rev104 (http://wxlua.svn.sourceforge.net/viewvc/wxlua/trunk/wxLua/modules/wxlua/src/wxlcallb.cpp?r1=100&r2=104&pathrev=104). The partial rolled back caused the issue with aborting a coroutine when wx module was loaded into that coroutine space (the application was crashing). I know it's a long shot and it may be just a coincidence that your symptoms look similar, but you may want to try to comment out this line in the diff I referenced (I haven't checked where it is in the current revision): m_wxlState = wxLuaState(wxlState.GetLuaState(), wxLUASTATE_GETSTATE|wxLUASTATE_ROOTSTATE); At least that fixed the issue for me (without any consequences as far as I can tell). I've been using this patched version for about 6 weeks running on Windows, Mac and Linux. Paul. On Mon, Sep 17, 2012 at 3:15 AM, Victor Bombi <so...@te...> wrote: >> Can you add this line to modules/luamodule/luamodule.cpp to help >> figure out what is happening and recompile? >> >> 50 BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, >> LPVOID ) >> 51 { >> >> printf("AAAAAAA %p %d : a %d d %d\n", hModule, >> (int)ul_reason_for_call, (int)DLL_PROCESS_ATTACH, >> (int)DLL_PROCESS_DETACH); fflush(stdout); >> >> 52 switch (ul_reason_for_call) >> 53 { >> ... >> > > Thank you for answering. I have solved the problems in my lualanes and wx > application. It seems that something is not working if I do > require"something" inside a lane that has not been required in the lua_state > where wx is loaded. When the lane is finished wx gets hanged (I guess that > when unloading the dll) so I am now requiring everything in the main > lua_state even if I dont need it. Another problem came from wx defining bit > instead of wx.bit so when I use bit from luaBitOp lanes get confused also (I > renamed it bitOp for solving). > > I have always wanted to require wx in a lane but because of "only once" dll > initialization it does not work. I am able to require wx from a lane if it > has not been required from the "main" lua_State. Do you thing it could be > changed anyhow so that luaopen_wx does not return lua_getglobal(L, "wx");? > Would that break wx? > > Best Regards > Victor Bombi > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > wxlua-users mailing list > wxl...@li... > https://lists.sourceforge.net/lists/listinfo/wxlua-users |