Will this leak memory?

Hi everyone,

I’m currently working on a module and I had to make this for the module to work.

-- Wait for player
if not Players.LocalPlayer then
	repeat task.wait(0.5) until Players.LocalPlayer
end

For some reason the module script loaded quicker than the player or something. Will this cause any memory leaks? Thanks.
Aki

2 Likes

You can answer this question yourself through stats in the developer console, I don’t think it will have any affect on the memory at all because of the high wait duration.

3 Likes

It will not, instead it would just yield the current script, and that’s about it.

3 Likes

Oh alright! Thanks to both! :slight_smile:

I’m a little uneducated when it comes to memory leaks, so that’s why I got a bit concerned haha.

1 Like

nope, this will not leak memory

not to be mistaken however, doing this on the server is unadvisable as it will keep repeating task.wait until the player is found.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.