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
[email protected]
https://lists.sourceforge.net/lists/listinfo/iup-users

Reply via email to