Calling YieldFunctions from BindToClose functions hangs Studio after clicking Stop button

Hi! I’ve been having a strange issue where calling any YieldFunction from a function passed to game:BindToClose() causes Studio to hang for about 30 seconds whenever the Stop button is clicked to exit test mode o:

BindToClose Hanging Repro.rbxl (16.0 KB)
Here is a simple place with nothing but a script with the following code:

game:BindToClose(function ()
	wait()
end)

After those ≈30 seconds, the “Not running script because past shutdown deadline” message is printed in Output several times:
image

11 Likes

Just hopped on and replicated this in my own enviorment.

I just started having this same issue.

1 Like

Yes, same, at first I thought it was related to the Roblox datastores module, but after wasting a few hours, before checking here, it is in the BindToClose, any sort of yield seems to do it. :stuck_out_tongue: Thats a lesson for me, check the Bugs forums.

3 Likes

I think I found a solution for this: