Studio Hang On Ending Test In Window - Not running script because past shutdown deadline

Reproduction:

  1. Open this place:
    BugTest2.rbxl (17.3 KB)
  2. Run in test in window
  3. Press Stop

What should happen: Well, the game stops and you go back to the editor

What actually happens:

  1. This window appears:
    image
  2. This appears in the output:
    image
    With the last line repeatedly being printed as long as studio remains open
  3. Studio is still technically responsive - Windows will not detect it as unresponsive, the window can be resized and moved about, and the animations for mouse over and clicking on buttons will still work, and you can still exit the program and open other places. However none of the other buttons will do anything, studio will not return to the editor, the viewport does not update correctly, and you cannot make any further changes to the place without restarting studio
    image
    (It might not be obvious if the site has clipped the image for you, but the viewport is actually showing fragments of studio itself when it was resized into full screen)
1 Like

I’m looking into this. Do you have any insight as to why this occurs on this place specifically?

I spent some more time checking it, and the repro seems to be quite simple:
Have a module use :BindToClose, and then have said module error before returning.

game:BindToClose(function()
	print("Server shutting down")
end)

error("Test")

return