On Sun, Nov 30, 2008 at 4:04 PM, arpin <[EMAIL PROTECTED]> wrote:
>
> Change all the call to LuaPCall to setup the result only when the code succeed
> ex:
>        m_wxlState.LuaPCall(1, 1);
> to
>        if (m_wxlState.LuaPCall(1, 1) == 0)
> the are a number of those lines
>
> This cause the program to crash particularly if the console is active.

I've been thinking about this. Currently; the pcall suppresses any
errors, which is bad, but any subsequent calls to get values from the
stack would error and that's where you crash I assume. If I catch the
error in pcall as above and don't get values from the stack, but make
the C++ function call with some sort of reasonable values it hides the
problem.

I think this code would be more appropriate, however I think it will
still crash for you. Could you test this?

if (m_wxlState.LuaPCall(1, 1) != 0)
    m_wxlState.wxlua_Error("Error in function... blah blah, get error
string from stack...");

Regards,
    John

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
wxlua-users mailing list
wxlua-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxlua-users

Reply via email to