If a script using game:BindToClose() is destroyed, then the Stop button in Studio breaks. This forces the user to have to exit out of Studio without stopping the game.
Easy to replicate:
With any place in Studio, create a new Script and put in any BindToClose code such as below:
game:BindToClose(function() --[[ Anything or nothing here ]] end)
Run the game
Delete the script
Press the Stop button in Studio
Notice error:
The “Show Details…” button literally just shows the contents of the Output window. Nothing useful there.
Possible scenario: You have a vehicle script that uses BindToClose to save data when the server closes, but you accidentally drive it off the map in Studio…now you’re unable to stop Studio
Actually this did happen to me when debugging some scripts that same code in it and it broke the stop button multiple times, actually confused me a few times.
Can confirm that this is still happening. The tycoon game I am working on has each tycoon save data by an individual script, which uses BindToClose. After adding the ability to rebirth upon completing the tycoon, the old one gets destroyed, and thus this issue occurs.
There is no way of getting around it easily, so my request is for it to get fixed.