On Sun, Jul 1, 2012 at 11:50 PM, Paul K <paulclin...@yahoo.com> wrote: > >> How exactly are you using the coroutines? You're creating one to run a >> Lua script and somehow debug it. Can the wxFrame live for longer than >> the life of coroutine? > > No, wxFrame can't live for longer than the life of coroutine. It is > indeed for ZeroBraneStudio, but indirectly; the IDE itself doesn't > depend on this, but the debugging component (provided by MobDebug: > https://github.com/pkulchenko/MobDebug) does. > > The logic in question is part of the controller() function and is a > completely generic code: > > local coro_debugee = coroutine.create(debugee) > debug.sethook(coro_debugee, debug_hook, "lcr") > local status, err = coroutine.resume(coro_debugee) > > It creates a coroutine for debugee (which is a function created as a > result of loadstring/loadfile, for example, debugee = > loadfile('minimal.wx.lua')), sets a debug hook on it and resumes it. > All wxlua logic is encapsulated there, but with this fix the execution > fails.
I see, this is a rather unique use case. I cannot think of any other way to use use an event callback in a coroutine that might work besides running the whole program in it as you're doing. I'm still suspicious since the coroutine will be suspended when event callbacks are called. Can you confirm if there aren't any problems if you debug a program in wxLua 2.8.10 with an OnPaint event handler and a wxMenu callback, debug past where the callbacks are connected and the event loop is running. Then cover and uncover the frame to run the OnPaint handler and open the menu item. Does it work as expected and can you debug into the callback function? The minimal.wx.lua sample has both of these and the wxLua.exe debugger works as expected. How does your use of coroutines compare? Regards, John ------------------------------------------------------------------------------ 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 wxlua-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wxlua-users