Hi Simon,

  I can't see anything wrong with your script.

  First, what do you mean by Debug Mode? Are you debugging the Visual C++
application or the Lua script? When not in debug mode it works?

  Second, you have a very peculiar configuration as we speak previously.
Maybe you will have to build IUP with debug information so we can see where
it is crashing.

  Can you send us the call stack at the crash (even using IUP without debug
info)?

Best,
Scuri



Em ter, 18 de jun de 2019 às 13:53, Simon Orde <
simono...@family-historian.co.uk> escreveu:

> Hi – I’m using Lua 5.3 and IUP 3.26 to run embedded Lua scripts in my
> Visual C++ 2017 application, and I’m having problems with IUP dialogs which
> cause my application to crash – but only in debug mode.  For example, the
> following script will cause my application to crash if (and only if) you
> click the OK button:
>
>
>
> require( "iuplua" )
>
>
>
> btn = iup.button { name="ok", title="OK",
>
>      action = function()
>
>                      return iup.CLOSE
>
>                      end
>
> }
>
> dlg = iup.dialog{btn; title="Test dialog"}
>
> dlg:show()
>
> iup.MainLoop()
>
> dlg:destroy()
>
>
>
>
>
> The crash actually occurs in the dlg:destroy() call.  If I comment out
> “return iup.CLOSE” it does not crash (and pressing OK doesn’t close the
> dialog either ).  If I close the dialog by clicking on the cross in the
> top-right corner it does not crash.  If I don’t comment out “return
> iup.CLOSE” but instead comment out dlg:destroy() it will crash my
> application when the script ends (but only if I’ve clicked the OK button).
>
>
>
> I know that iup.GetParams is implemented using an iup dialog, but that
> seems to work fine for me.  For example, this code does not crash even if I
> click the OK button to close the dialog:
>
>
>
> require("iuplua")
>
>
>
> iTest = 1
>
>
>
> iup.GetParam("Options", nil, "Test %i\n", iTest)
>
>
>
>
>
> Presumably iup.GetParam must be doing something very similar to what I’m
> trying to do.  But it is doing it in a way that does not crash my app.
> Anyone got any thoughts on what’s going wrong?  All help much appreciated.
>
>
>
> Simon
>
>
> _______________________________________________
> Iup-users mailing list
> Iup-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/iup-users
>
_______________________________________________
Iup-users mailing list
Iup-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iup-users

Reply via email to