Note that this isn’t Calling YieldFunctions from BindToClose functions hangs Studio after clicking Stop button
At least for me, just having a
wait() resumes properly
My repro is this:
local t game:BindToClose(function() print'closing' t=coroutine.running() print'set t;yielding' local s=tick() coroutine.yield() print('unyielded after '..(tick()-s)) end) print'waiting for t' repeat until t or not wait() print'got t' coroutine.resume(t) print'resumed t'
Relevant studio output shows:
waiting for t closing set t;yielding 19:34:38.276 - Disconnect from 127.0.0.1|63659 got t unyielded after 0.03760552406311 resumed t
As you can see, my thread supposedly unyields after the expected ~1/30 seconds yet if you actually run the code in studio, studio freezes for ~30 seconds (the timeout)