Page 1 of 1

Script can crash moho

Posted: Thu Dec 29, 2005 7:27 am
by macton
point.fAnimPos:SetValue( moho.frame, nil ) will crash Moho.
Obviously a bug in the script, but you had mentioned in another thread that you wanted to protect Moho from crashing on bad scripts.

Edit: This is in a tool script

Also, improperly trying to access functions can crash Moho in a tool script.
e.g.
LM.Beep() (instead of LM:Beep())

Posted: Thu Dec 29, 2005 8:28 pm
by Lost Marble
Yes, it is possible for a script to crash Moho. Lua itself is supposed to prevent crashing, but when you call Moho functions, you are basically calling C++ functions, so passing invalid data (in particular, invalid or NULL pointers) can cause a crash. It would be quite difficult to avoid these problems in all cases, but I'm not even sure if it's desireable. It would introduce a lot of parameter checking that would slow things down.