Call Stack window refreshing every time a new 'thread'/'context' is created

This heartbeat event will trigger ~ 60 events a second, thus creates 60 new threads/contexts/whatever they’re called nowadays:

[code]local runService = game:GetService(“RunService”);

runService.Heartbeat:connect(function()
– magic
end);

function x()
– complex computation below
local a = 1 + 1; – << BREAKPOINT HERE >>
end

x();
[/code]

Add a breakpoint at the specified location then run the code, the call stack window is pretty much completely useless then since it constantly refreshes and isn’t responsive because a new script context is created every 1/60th sec. It’s quite annoying.

Running on Windows 7.

Try using ‘wait’ instead:

spawn(function()
while (true) do
runService.Heartbeat:wait()
-- Magic
end
end)

-- ...

That’d certainly solve it, but I’d argue this is still a bug/unintended behavior.

There’s definitely a flaw, which is that the debugger depends on RunService to halt everything. The problem is that events like Heartbeat and RenderStepped fire independently of RunService’s state.

For now, if this is preventing you from debugging, you can temporarily swap Heartbeat or RenderStepped with Stepped, which does depend on RunService.

That makes more sense for sure, those events shouldn’t even fire if the scripts are all halted :P.

I’m just resorting back to the good old prints for the time being, since replacing all Heartbeat/RenderStepped events is boring, thanks though :).