Steps to reproduce FCEUX crashing if you stop the script, and then try to close open Modal Box. Wanted to debug something, and came across this. Not that I really want an infinite loop of popups or anything...
1) Open FCEUX
2) File->LUA->New Script Window
3) Open the script
4) Click Run
5) Click Stop Script button
6) Press close window (X) button.
7) FCEUX crashes.
ex: This is a copy paste of the most important parts. Was messing with gd, and had lots of messy code, this is a simple example. A loop with the input popup.
local sprite_hp = 0x0440;
while (true) do
for i = 0x00, 0x0F, 0x01 do
input.popup( "HP" ..tostring(memory.readbyte(sprite_hp + i)) .. " . For i value:".. i)
end
FCEU.frameadvance()
end
I don't think this peculiar case can be easily fixed. The priority is to let user forcefully stop Lua at any given moment, even when Lua thread havent finished working.